List of helpful shortcuts for faster coding
If you have any other helpful shortcuts, feel free to add in the comments of this gist :)
Open Terminal Ctrl+Alt+T
Download Firefox Developer Edition tar file
wget https://download.mozilla.org/?product=firefox-aurora-latest-ssl&os=linux64&lang=en-US
Copy tar file to opt
sudo cp -rp firefox-35.0a2.en-US.linux-x86_64.tar.bz2
Open opt
folder (cd /opt/
) and untar file
sudo tar xjf firefox-35.0a2.en-US.linux-x86_64.tar.bz2
Rust error handling is nice but obligatory. Which makes it sometimes plenty of code.
Functions return values of type Result that is "enumeration". In Rust enumeration means complex value that has alternatives and that alternative is shown with a tag.
Result is defined as Ok or Err. The definition is generic, and both alternatives have
The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.
With ffmpeg
this can be achieved with -c copy
. Older examples may use -vcodec copy -acodec copy
which does the same thing.
These examples assume ffmpeg
is in your PATH
. If not just substitute with the full path to your ffmpeg binary.
for %%f in (*.flv) do ( | |
ffmpeg -i "%%~nf.flv" -vcodec copy -acodec copy "%%~nf.mp4" | |
) |
docker kill $(docker ps -q)
to kill all running containers
docker rm $(docker ps -a -q)
to delete all stopped containers.
docker volume rm $(docker volume ls -q)
to delete all volumes.
docker rmi $(docker images -q)
to delete all images.
Run all commands:
docker kill $(docker ps -q) && docker rm $(docker ps -a -q) && docker volume rm $(docker volume ls -q) && docker rmi $(docker images -q)
For fish shell, remove the $
:
alias dockerfile='script.sh' | |
script.sh: | |
#!/bin/bash | |
echo "FROM scratch" | |
docker history --no-trunc $@ | tac | tr -s ' ' | cut -d " " -f 5- | sed 's,^/bin/sh -c #(nop) ,,g' | sed 's,^/bin/sh -c,RUN,g' | sed 's, && , \\\n & ,g' | sed 's,\s*[0-9]*[\.]*[0-9]*\s*[kMG]*B\s*$,,g' | head -n -1 | |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the \
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)