Skip to content

Instantly share code, notes, and snippets.

View giannisp's full-sized avatar

Ioannis Poulakas giannisp

View GitHub Profile
@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:bf7007dc741ba6a10a9dd084ed4af6de
Created April 12, 2017 07:09
List global NPM installed packages
npm ls -g --depth 0
@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: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 [email protected]
brew unlink [email protected]
brew link postgresql
@giannisp
giannisp / gist:1ed3665af198f62271712569e14ac808
Created October 20, 2017 18:10
Ubuntu 17.10 - Move window buttons to the left
# Move to the left
gsettings set org.gnome.desktop.wm.preferences button-layout 'close,maximize,minimize:'
# Move to the right
gsettings set org.gnome.desktop.wm.preferences button-layout ':close,maximize,minimize'
@giannisp
giannisp / gist:5a488a793ed3a3dbabe689fea5ee65ae
Created January 24, 2018 08:13
Disable ApplePressAndHoldEnabled for VS Code
defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
@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