This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sed -i ':a;N;$!ba;s/\[user\]\n//g' $file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gc | |
{ | |
dir=`pwd` | |
subdir=${dir%SPECIFIC_DIR*} | |
if [ "$subdir" != "$dir" ]; then | |
# do something | |
fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ssh_connect () | |
{ | |
SSH_EXECUTE_COMMAND="sshpass -p $2 ssh -t $1@$3 '$4'" | |
eval $SSH_EXECUTE_COMMAND | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for file in *.jpg; | |
do OUT=${file%*.jpg}.pdf; | |
convert -quality 300 -resize 60% $file $OUT; | |
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -dDetectDuplicateImages -dCompressFonts=true -sOutputFile=out.pdf $OUT; | |
mv out.pdf $OUT; | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com XXXXXXX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to make opened Markdown files always be soft wrapped: | |
# | |
# path = require 'path' | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Backup | |
sudo dd if=/dev/sda | gzip > /path/to/backup.iso.gz | |
# Restore | |
sudo bash -c "gzip -dc /path/to/backup.iso.gz | dd of=/dev/sda" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
code: | |
image: debian:jessie | |
volumes: | |
- .:/var/www/html | |
mysql: | |
image: mysql | |
environment: | |
MYSQL_DATABASE: root | |
MYSQL_ROOT_PASSWORD: root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
VIDEO="vlc" | |
echo "Which stream?" | |
read stream | |
starting_video_proc_count=`ps aux | grep -v grep | grep $VIDEO | wc -l` | |
nohup livestreamer twitch.tv/$stream best &>/dev/null & export LIVESTREAMER_ID=$! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setfacl -R -d -m g::rwx . | |
# will set newly created files and folders ...rwx...+ :) |
OlderNewer