arthuralvim / dotfiles

My dotfiles.
3 stars 0 forks source link

Adicionar novos comandos no histórico #34

Closed arthuralvim closed 2 years ago

arthuralvim commented 5 years ago

yarn list --depth=0

arthuralvim commented 5 years ago
sed -i '' 's/<string-pattern>/<string-substitute>/g' *
find . -name "*.log" -exec sed -i '' 's/<string-pattern>/<string-substitute>/g' {} \;
arthuralvim commented 5 years ago
7za a <package.7z> <folder-or-file>
7z x <package.7z>
arthuralvim commented 5 years ago
rsync -vazh --dry-run --partial root@<host>:<path/to/app>  <local/path>
arthuralvim commented 5 years ago
git remote add <reference> git@github.com:<user>/<repo>.git
chalice new-project <project-name>
arthuralvim commented 5 years ago
pipenv install -r requirements.txt
arthuralvim commented 5 years ago
cat ~/.ssh/id_rsa.pub | ssh root@your.ip.address "cat >> ~/.ssh/authorized_keys"
arthuralvim commented 4 years ago
convert +append a.png b.png c.png
arthuralvim commented 4 years ago
alias please='sudo'
alias porfavor='sudo'
arthuralvim commented 4 years ago
pdftohtml -c file.pdf output.html
arthuralvim commented 4 years ago

Aproveitar e procurar saber como não sujar o histórico com comandos inválidos.

arthuralvim commented 4 years ago
aws configure list
arthuralvim commented 4 years ago
for i in *; do tar -czvf "$i.tar.gz" "$i"; done
for i in *; do tar -cjvf "$i.bz2" "$i"; done
for i in *; do mv "$i" "$i.csv"; done
arthuralvim commented 4 years ago
split -l <number-of-lines> <file-example.csv>
arthuralvim commented 4 years ago
PGPASSWORD=blabla psql --host="rds-example.us-east-1.rds.amazonaws.com" --username=user --dbname=database_name --port=5432 -c "COPY (SELECT id, nome FROM public.table_name WHERE ID BETWEEN 2000000 and 2500000) TO STDOUT WITH (FORMAT CSV, HEADER, QUOTE '\"', DELIMITER ',', ESCAPE '\', FORCE_QUOTE(nome));" > part-5.csv
arthuralvim commented 4 years ago
psql --host=mypostgresql.c6c8mwvfdgv0.us-west-2.rds.amazonaws.com --port=5432 --username=awsuser --password --dbname=mypgdb 
arthuralvim commented 4 years ago
http "https://<elasticsearch-endpoint>/_cat/indices?v"
http "https://<elasticsearch-endpoint>/<index>/_count"
http "https://<elasticsearch-endpoint>/<index>/_search?pretty"
logstash -f logstash.conf
logstash-plugin install <plugin>
logstash-plugin install logstash-output-amazon_es
arthuralvim commented 4 years ago
telnet <endpoint> port
nc -zv <endpoint> port
nslookup <endpoint>
arthuralvim commented 4 years ago
alias j12="export JAVA_HOME=`/usr/libexec/java_home -v 12`; java -version"
alias j11="export JAVA_HOME=`/usr/libexec/java_home -v 11`; java -version"
alias j10="export JAVA_HOME=`/usr/libexec/java_home -v 10`; java -version"
alias j9="export JAVA_HOME=`/usr/libexec/java_home -v 9`; java -version"
alias j8="export JAVA_HOME=`/usr/libexec/java_home -v 1.8`; java -version"
alias j7="export JAVA_HOME=`/usr/libexec/java_home -v 1.7`; java -version"
arthuralvim commented 4 years ago

SQLWorkbenchJ

ln -s /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk /Applications/SQLWorkbenchJ.app/Contents/PlugIns/adoptopenjdk-8.jdk

You can specify the JVM for the app like this: ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk /Applications/SQLWorkbenchJ.app/Contents/PlugIns/jdk1.8.0_152.jdk

and edit /Applications/SQLWorkbenchJ.app/Contents/Info.plist, adding:

<key>JVMRuntime</key>
<string>jdk1.8.0_152.jdk</string>
arthuralvim commented 4 years ago

alias py2server='python -m SimpleHTTPServer' alias py3server='python -m http.server' alias pyserver='python -m http.server'

arthuralvim commented 4 years ago
aws-es-proxy -endpoint <https://search.us-east-1.es.amazonaws.com>
arthuralvim commented 4 years ago

sudo LS_JAVA_OPTS="-Xmx30g -Xms25g" /usr/share/logstash/bin/logstash -f logstash-pg-cnseg-production.conf

arthuralvim commented 4 years ago

Testing monit...

curl -v http://admin:monit@localhost:2812
arthuralvim commented 4 years ago

monit status monit reload monit -t monit start all

arthuralvim commented 4 years ago

poetry config --list poetry env info --path [ -z "${VIRTUAL_ENV:-}" ] && source "$( poetry env info --path )/bin/activate" source "$( poetry env info --path )/bin/activate"

poetry run which python

arthuralvim commented 4 years ago

git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%h %s"

arthuralvim commented 4 years ago

poetry config --list poetry config virtualenvs.create false poetry update poetry new --name poetry init poetry install poetry install --no-dev poetry install -E mysql -E pgsql poetry add poetry add --dev poetry remove poetry add "pendulum>=2.0.5" poetry add pendulum@latest poetry add git+https://github.com/sdispater/pendulum.git poetry add ./my-package/ poetry add ../my-package/dist/my-package-0.1.0.tar.gz poetry add ../my-package/dist/my_package-0.1.0.whl poetry show poetry build poetry publish --repository (-r): The repository to register the package to (default: pypi). Should match a repository name set by the config command. --username (-u): The username to access the repository. --password (-p): The password to access the repository. config poetry run python -V poetry shell poetry check poetry env poetry env use /full/path/to/python poetry env use python3.7 poetry env info poetry env remove /full/path/to/python poetry env remove python3.7 poetry env remove 3.7 poetry env remove test-O3eWbxRl-py3.7 poetry env remove $(basename poetry env info --path)

arthuralvim commented 4 years ago

https://www.tecmint.com/delete-all-files-in-directory-except-one-few-file-extensions/ https://stackoverflow.com/questions/9157138/recursively-counting-files-in-a-linux-directory https://www.2daygeek.com/linux-count-files-folders-directories/ https://stackoverflow.com/questions/13032701/how-to-remove-folders-with-a-certain-name https://askubuntu.com/questions/377438/how-can-i-recursively-delete-all-files-of-a-specific-extension-in-the-current-di

arthuralvim commented 4 years ago

find . -type d -name node_modules -prune -exec rm -rf {} \; find . -type d -name bower_components -prune -exec rm -rf {} \;

arthuralvim commented 4 years ago
$ mediainfo --Output=JSON <video.mp4> > output.txt
$ ffprobe -show_streams -show_format <video.mp4> > output.txt
$ ffmpeg -i <video.mp4> -c copy -map_metadata 0 -map_metadata:s:v 0:s:v -map_metadata:s:a 0:s:a -f ffmetadata output.txt
$ ffmpeg -i <video.mp4> -f ffmetadata output.txt
arthuralvim commented 4 years ago
$ htpasswd -b .htpasswd <username> <password>
$ htpasswd -bc .htpasswd <username> <password>
arthuralvim commented 4 years ago
$ ansible-vault encrypt <file>
$ ansible-vault decrypt <file>
$ ansible-vault view <file>
$ ansible-vault edit <file>
arthuralvim commented 3 years ago
PGPASSWORD=HUAHUAHUA pg_dump -v -h <host> -U <user> -d <database> -p 5432 -t '<schema>.<table>' --schema-only > sql/output.sql
arthuralvim commented 3 years ago
$ ioreg -p IOUSB -w0 -l
$ ioreg -p IOUSB -w0 | sed 's/[^o]*o //; s/@.*$//' | grep -v '^Root.*'
$ system_profiler SPUSBDataType
arthuralvim commented 3 years ago
$ sudo dmesg -wH
$ watch 'sudo dmesg | tail -50'
$ sudo killall AppleCameraAssistant
$ sudo killall PTPCamera
$ ioreg -p IOUSB -l -w 0 -x
arthuralvim commented 3 years ago

remover o -f do comando.

PGPASSWORD="<password>" pg_restore -v -h <host>.rds.amazonaws.com -U <user> -d <database-name> -p 5432 /path/to/file.dump
arthuralvim commented 3 years ago
$ ttyrec bacon
# do some stuff
ctrl-D
$ ttygif bacon
$ gifsicle -O3 -k 8 --lossy=80 -o tty-small.gif tty.gif
$ ls -alh tty*.gif
-rw-rw-r-- 1 bob bob 386K Oct  6 16:10 tty.gif
-rw-rw-r-- 1 bob bob 186K Oct  6 16:12 tty-small.gif
arthuralvim commented 3 years ago

convert file.pdf -compress Zip compressed-file.pdf

arthuralvim commented 2 years ago

git clean -fd

arthuralvim commented 2 years ago
cd /path/to/files &&
for file in *.mp3 *.mp4; do
    if [[ -f "$file" ]]; then
        if [[ -f "${file}.md5" ]]; then
        echo "already exists: ${file}.md5"
        else
            md5sum -- "$file" > "${file}.md5";
            cat "${file}.md5";
        fi
    fi
done
arthuralvim commented 2 years ago

ssh pi@<retropie-address>

arthuralvim commented 2 years ago

yt-dlp <url>