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
@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"
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 / pre-push.md
Last active April 17, 2016 08:32
pre-push git hook - smoke tests & when successful pushes to mirrors

pre-push hook:

set -eu
remote="$1"
url="$2"
BRANCH=`git branch | grep "^* [a-zA-Z]" | cut -c 3- `

# npm run lint && npm run jscs  && npm run test &&
if [ $remote == 'origin' ]
then
git config --global url.https://github.com/.insteadOf git://github.com/
@sverweij
sverweij / vi-mode-for-bash-and-gnu-readline.md
Last active January 25, 2017 21:08
switch on vi mode for bash and stuff using gnu-readline

In the .inputrc add set editing-mode vi (for bash and other stuff using gnu readline) ... or in the .bashrc add set -o vi (if you want to use it in bash only)

Source (with lots of good nuggets): http://blog.sanctum.geek.nz/vi-mode-in-bash/