Skip to content

Instantly share code, notes, and snippets.

View giannisp's full-sized avatar

Ioannis Poulakas giannisp

View GitHub Profile
@giannisp
giannisp / gist:f0f3f45e6ecdfe904f33f334695bd160
Created April 24, 2017 16:05
Produce a cross-browser compatible video for using on a video tag
ffmpeg -i source.mp4 -vcodec libx264 -pix_fmt yuv420p target.mp4
@giannisp
giannisp / gist:bf7007dc741ba6a10a9dd084ed4af6de
Created April 12, 2017 07:09
List global NPM installed packages
npm ls -g --depth 0
@giannisp
giannisp / hsts-delete-domain
Last active April 24, 2017 05:38
Automate HSTS domain delete action on Chrome (macOS)
#!/usr/bin/env osascript -l JavaScript
function run(domain) {
const Chrome = Application('Google Chrome');
Chrome.activate();
const window = Chrome.windows[0];
const tab = Chrome.Tab({
url: 'chrome://net-internals/#hsts',
});
@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
@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:495fc0f1c0474088e5c5033f6db1a4d8
Last active March 29, 2022 15:55
Calculate SHA256 checksum
shasum -a 256 file.ext
@giannisp
giannisp / gist:f088e793c7361cdac849dd48cbdd66fe
Created January 14, 2017 18:53
List Atom installed packages
apm list --installed --bare
@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: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>"