Skip to content

Instantly share code, notes, and snippets.

View anubhavsahoo's full-sized avatar

loneranger anubhavsahoo

View GitHub Profile
@anubhavsahoo
anubhavsahoo / vid-tips
Last active September 7, 2018 10:13
Video compression / conversion
### Convert mov to gif
### on mac
#prereq
brew install ffmpeg
brew cask install xquartz
brew install gifsicle
#command
ffmpeg -i in.mov -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif
@anubhavsahoo
anubhavsahoo / vid-tips
Created September 7, 2018 10:12
Video compression / conversion
##on mac
#prereq
brew install ffmpeg
brew cask install xquartz
brew install gifsicle
#command
ffmpeg -i in.mov -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif
@anubhavsahoo
anubhavsahoo / git-tips
Last active June 28, 2018 10:58
git snippets and shortcuts
#merge strategy for code that is partially merged
git merge --no-commit -s recursive -X ours master
To be updated
# any bash script that takes more than 5 mins to craft or google
#wget parallel / multi download
cat ../image-names | xargs -I {} echo "https://photos.net/photos/default/"{} | xargs -n1 -P16 wget
#wget a sitemap
wget --quiet http://www.xyz.com/sitemap.xml --output-document - | egrep -o "http?://[^<]+" | wget -i -
## then parse all urls
egrep -o "http?://[^<]+" sitemap-pt-p* | grep -vi schema | cut -c29- > ../all-posts-urls
#installation
sudo apt-get update
sudo apt-get install -y apache2 libapache2-mod-php5 unzip mysql-server libapache2-mod-auth-mysql php5-mysql php5-intl mcrypt php5-mcrypt
sudo a2enmod php5
sudo php5enmod mcrypt
sudo apt-get install php5-imap
sudo php5enmod imap
cd /tmp/
#installation
sudo apt-get update
sudo apt-get install -y apache2 libapache2-mod-php5 unzip mysql-server libapache2-mod-auth-mysql php5-mysql php5-intl mcrypt php5-mcrypt
sudo a2enmod php5
sudo php5enmod mcrypt
sudo apt-get install php5-imap
sudo php5enmod imap
cd /tmp/
@anubhavsahoo
anubhavsahoo / aws-tips
Last active November 17, 2016 10:40
Tips for managing AWS
#
# mounting an EBS volume
#
#Format volume
sudo mkfs.ext4 /dev/xvdf #/dev/sdf maps to /dev/xvdf on ubuntu
#Mount volume
sudo mkdir -m 000 /vol
echo "/dev/xvdf /vol auto noatime 0 0" | sudo tee -a /etc/fstab