Skip to content

Instantly share code, notes, and snippets.

View giannisp's full-sized avatar

Ioannis Poulakas giannisp

View GitHub Profile
@giannisp
giannisp / gist:45ab01577cefc8113b43ef186b903388
Created March 18, 2018 09:56
7z encryption (AES256 + encrypted filenames)
7z a file.7z file.txt -mhe=on -p1234
@giannisp
giannisp / gist:12bf8b6f04da064a1cafdfc570155624
Created April 2, 2018 14:24
Fetch SSL certificate info from the CLI
openssl s_client -showcerts -connect example.com:443
@giannisp
giannisp / gist:014ab4a30a1c968f599f81d86bc4909a
Created April 15, 2018 14:46
Extract EXIF image data with ImageMagick
identify -format '%[EXIF:*]' image.jpg
@giannisp
giannisp / gist:daa5150ae1a1ae6c829ffc84b230b82f
Created April 23, 2018 14:15
Update time/date on macOS
sudo ntpdate -u time.apple.com
@giannisp
giannisp / gist:3053a020d1e1f4054ca1001e53238928
Created June 26, 2018 17:11
Parse iana timezone names using jq
cat 2018e.json | jq '{ version: .version, zones: [.zones[].name] }' > timezones.json
@giannisp
giannisp / gist:2ce8cc5998254815408fbe1549cd2c85
Created July 23, 2018 06:06
Disable docker container auto-restart
docker update --restart=no container
@giannisp
giannisp / gist:fb7ed841e702dc3dc58b7f1a933642e6
Created September 25, 2018 07:20
Fix for thin fonts on macOS Mojave (10.14)
defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO
@giannisp
giannisp / gist:b53a76047b07751ed3ade3c1db1d2c51
Created November 18, 2016 05:50
Upgrade PostgreSQL 9.5.5 to 9.6.1 using Homebrew (macOS)
After automatically updating Postgres to 9.6.1 via Homebrew, the pg_ctl start command didn't work.
The error was something like "database files are incompatible with server".
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.1 and latest 9.5.x installed, and keep 9.6.1 as default
brew unlink postgresql
brew install postgresql95
brew unlink postgresql95
brew link postgresql
@giannisp
giannisp / gist:848636b35837c0e98324ef5ac5f2aa15
Last active November 20, 2021 08:22
Fix ssh key issues on macOS Sierra 10.12.x
# store passphrase on keychain
ssh-add -K
# and/or add to ~/.ssh/config:
Host *
UseKeychain yes
@giannisp
giannisp / gist:922338526de5cad740b15703ab6f98b3
Created January 5, 2017 15:30
HLS stream to RMTP (for Facebook Live)
brew install ffmpeg
ffmpeg -re -i "https://<HLS-url>/playlist.m3u8" -acodec libmp3lame -ar 44100 -b:a 128k -pix_fmt yuv420p -profile:v baseline -s 426x240 -bufsize 6000k -vb 400k -maxrate 1500k -deinterlace -vcodec libx264 -preset veryfast -g 30 -r 30 -f flv "rtmp://rtmp-api.facebook.com:80/rtmp/<rmtp-url>"