Skip to content

Instantly share code, notes, and snippets.

@nikhan
nikhan / twitter.sh
Created January 1, 2016 04:45
twitter ffmpeg
ffmpeg -i test.mov -vcodec libx264 -vf 'scale=640:trunc(ow/a/2)*2' -acodec aac -vb 1024k -minrate 1024k -maxrate 1024k -bufsize 1024k -ar 44100 -strict experimental -r 30 out.mp4
@nikhan
nikhan / gist:db148ad236f485fce806
Last active July 14, 2020 04:53
Share Whatever over Google Tone
// send whatever message you want over Google Tone
// as far as I can tell, profile images must live on googleusercontent.com
// data.url must look like a url
// setting AUDIBLE_DURATION to 1 will generate no audible sound but result in a successful transmission.
//
// to use:
// 0. install Google Tone https://chrome.google.com/webstore/detail/google-tone/nnckehldicaciogcbchegobnafnjkcne
// 1. open settings > extentions
// 2. click "options" under Google Tone
// 3. In the Google Tone options, open the developer console and paste the following
@nikhan
nikhan / nowake.service
Last active June 27, 2018 07:02
ubuntu/macbook 2015 - stop waking up upon suspend fix, as systemd unit
# ubuntu 17.04 / macbook pro retina 2015 13
#
# place in /etc/systemd/system
# systemctl daemon-reload
# systemctl enable nowake.service
# systemctl start nowake.service
#
# verify with `cat /proc/acpi/wakeup`
# XHC1 should be disabled
# disable more as needed
@nikhan
nikhan / config
Last active June 7, 2018 00:35
ubuntu/macbook i3 config
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
@nikhan
nikhan / network-ubuntu-macbook.md
Last active May 9, 2017 05:25
fix wifi on ubuntu 17/macbook pro 13 2015

Ubuntu 17.04 on 2015 macbook pro 13 - fix for slow wifi

sudo gedit /etc/modprobe.d/brcmfmac.conf

enter:

options brcmfmac qos=0
options brcmfmac nohwcrypt=1
@nikhan
nikhan / i3lock.service
Created April 29, 2017 22:01
ubuntu/macbook - lock i3 on suspend
# source: https://bbs.archlinux.org/viewtopic.php?pid=1170536#p1170536 by 65kid
#
[Unit]
Description=i3lock
Before=sleep.target
[Service]
User=nik
Type=forking
Environment=DISPLAY=:0
@nikhan
nikhan / color_test
Created April 29, 2017 06:42
bash 256 color test
for i in {0..255} ; do
printf "\x1b[48;5;%sm%3d\e[0m " "$i" "$i"
if (( i == 15 )) || (( i > 15 )) && (( (i-15) % 6 == 0 )); then
printf "\n";
fi
done
@nikhan
nikhan / zazen.vim
Created April 29, 2017 06:41
ubuntu/macbook (fixed for 256 color)
" =============================================================================
" File: zazen.vim
" Description: Vim color scheme file
" Maintainer: Zoltan Dezso
" =============================================================================
" (fixed status line)
set background=dark
highlight clear
if exists("syntax_on")
syntax reset
@nikhan
nikhan / .Xresources
Created April 29, 2017 06:41
ubuntu/macbook
! for hidpi
Xft.dpi:120
Xft.antialias: true
Xft.rgba: none
!
Xft.hinting: true
Xft.autohint: true
Xft.hintstyle: hintslight
@nikhan
nikhan / .Xmodmap
Last active April 29, 2017 06:39
ubuntu/macbook
! macbook 2015/ubuntu 17.04
! Exchange left Alt and left Win
remove mod1 = Alt_L
remove mod4 = Super_L
add mod1 = Super_L
add mod4 = Alt_L
! Exchange tilde and lesser/greater
keycode 94 = grave asciitilde dead_grave dead_tilde grave asciitilde
keycode 49 = less greater less greater bar brokenbar bar brokenbar