Skip to content

Instantly share code, notes, and snippets.

View sverweij's full-sized avatar
🌪️
fighting entropy

Sander Verweij sverweij

🌪️
fighting entropy
View GitHub Profile
sudo mdutil -a -i off
@sverweij
sverweij / gist:1c91ecc803d7d89b6120
Last active August 29, 2015 14:06
Block sony xperia "What's new" sweep gesture. Without root.

Pre-requisites

  • developer options switched on on phone
  • adb installed on computer (macosx: brew install android-platform-tools)

Steps

  • switch on debugging on the phone
  • connect the phone to the computer
  • start the adb shell

💬 input:

@sverweij
sverweij / gist:11aedcbb5f97bd9d6595
Created February 27, 2015 22:11
setting up travis -
  • make sure each active branch contains a .travis.yaml
  • if you want to build gh-pages: explicitly include it in the .travis.yaml
@sverweij
sverweij / gist:efe1ab3723e7bb76898d
Last active August 29, 2015 14:18
Connection sharing on microsoft windows machines

TL;DR

netsh wlan set hostednetwork mode=allow "ssid=AIVDSurveilanceCar1" “key=PreferablyaVerylooongpassword” keyUsage=persistent
netsh wlan start hostednetwork

landline connection -> properties -> Sharing -> Share to Wireless Network Connection 2

Does not work with cisco VPN.

Slow explanation

@sverweij
sverweij / gist:44db8a829054d1c8030e
Created September 5, 2015 20:12
Split off audio from a video file
### just splitting it off (which is _fast!_):
ffmpeg -i inputvideo.mp4 -c:a copy -vn -sn outputaudio.mp4
### converting it to mp3
ffmpeg -i inputvideo.mp4 -vn -b:a 128k -c:a libmp3lame outputaudio.mp3
@sverweij
sverweij / notificationcenter_die.sh
Created January 5, 2014 17:20
Permanently kill MacOSX notification center
#!/bin/sh
# this one actually works great
launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist
killall NotificationCenter
# An alternative method, requiring root permission:
# http://www.maclife.com/article/howtos/how_disable_notification_center_mountain_lion
# requiring root permission:
#
# sudo defaults write /System/Library/LaunchAgents/com.apple.notificationcenterui KeepAlive -bool false
@sverweij
sverweij / deduplicateopenwithmenus.sh
Created January 5, 2014 17:22
De-duplicate MacOSX "open with" menus
#!/bin/sh
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain user
killall Finder
echo "Open With has been rebuilt, Finder will relaunch"
git config --global url.https://github.com/.insteadOf git://github.com/
@sverweij
sverweij / sudo-on-current-tty-only.md
Created March 26, 2016 09:30
Prevent sudo from escalating to other ttys
sudo visudo

and somewhere in that file add

Defaults tty_tickets
@sverweij
sverweij / nvm-outdated-alias
Last active April 17, 2016 08:01
quick, ugly, unpolished 'nvm outdated' alias hack
alias nvm-outdated='NVM_REMOTE_LS=`mktemp` && NVM_LOCAL_LS=`mktemp` && nvm ls-remote 0.12 | tail -1 > $NVM_REMOTE_LS && nvm ls-remote 4 | tail -1 >> $NVM_REMOTE_LS && nvm ls-remote 5 | tail -1 >> $NVM_REMOTE_LS && nvm ls | head -3 > $NVM_LOCAL_LS && diff $NVM_REMOTE_LS $NVM_LOCAL_LS && rm $NVM_REMOTE_LS $NVM_LOCAL_LS'
# note: when succesfull & no changes shows '-bash: echo: write error: Broken pipe'
# which is because piping nvm ls to something does that (2> 'ing it to /dev/null doesn't work)
# this alias is useful as well in the same context (and works with_out_ hitches)
alias nvm-latest='nvm ls-remote 0.12 | tail -1 > a && nvm ls-remote 4 | tail -1 >> a && nvm ls-remote 5 | tail -1 >> a && cat a && rm a'