Skip to content

Instantly share code, notes, and snippets.

View giannisp's full-sized avatar

Ioannis Poulakas giannisp

View GitHub Profile
@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:330a7977e880f3496519f925b4dea3ea
Created January 2, 2017 10:40
Quicktime mov screencast to gif
brew install ffmpeg
brew install gifsicle
ffmpeg -i screencast.mov -s 600x120 -pix_fmt rgb24 -r 30 -f gif - | gifsicle --optimize=3 --delay=3 > screencast.gif
brew install imagemagick
convert icon.png favicon.ico
@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>"
@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:1d8dc9a6ed13876c51ccfe9fefcb311e
Created January 13, 2017 09:50
Using lodash from Chrome's dev tools console
# How to make lodash available via "_" on console
var el = document.createElement('script');
el.src = 'https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.js';
document.getElementsByTagName('head')[0].appendChild(el);
# Use _.VERSION or any other function to verify that it worked
# lodash 4.x version quick link:
https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.js
@giannisp
giannisp / gist:f088e793c7361cdac849dd48cbdd66fe
Created January 14, 2017 18:53
List Atom installed packages
apm list --installed --bare
@giannisp
giannisp / gist:495fc0f1c0474088e5c5033f6db1a4d8
Last active March 29, 2022 15:55
Calculate SHA256 checksum
shasum -a 256 file.ext
@giannisp
giannisp / gist:798c2c34a3f8df0f249af28500236c4d
Created February 8, 2017 07:37
Verify that an SSL certificate and key are matching
# md5 sums should match
openssl x509 -noout -modulus -in server.crt| openssl md5
openssl rsa -noout -modulus -in server.key| openssl md5
@giannisp
giannisp / gist:293693c3234216913e61531ea871905a
Last active March 3, 2017 07:00
Convert docx to markdown
# Pandoc has to be installed (http://pandoc.org/)
# on OS X it can be easily installed via brew
brew install pandoc
pandoc -s file.docx -t markdown -o file.md