Skip to content

Instantly share code, notes, and snippets.

View giannisp's full-sized avatar

Ioannis Poulakas giannisp

View GitHub Profile
@giannisp
giannisp / gist:ebaca117ac9e44231421f04e7796d5ca
Last active July 14, 2024 18:27
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
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.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
@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:495fc0f1c0474088e5c5033f6db1a4d8
Last active March 29, 2022 15:55
Calculate SHA256 checksum
shasum -a 256 file.ext
@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: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: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:2ce8cc5998254815408fbe1549cd2c85
Created July 23, 2018 06:06
Disable docker container auto-restart
docker update --restart=no container
@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:daa5150ae1a1ae6c829ffc84b230b82f
Created April 23, 2018 14:15
Update time/date on macOS
sudo ntpdate -u time.apple.com