This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TEMP=`mktemp /tmp/dbusconf.XXXXXX` | |
| # generate dbus config that allows everything | |
| echo '<busconfig><type>system</type><listen>d</listen><auth>ANONYMOUS</auth><allow_anonymous/><policy context="default"><allow send_destination="*" eavesdrop="true"/><allow eavesdrop="true"/><allow own="*"/></policy></busconfig>' > $TEMP | |
| dbus-daemon --nofork --config-file $TEMP --address tcp:bind=0.0.0.0,port=1234 | |
| rm $TEMP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80; | |
| server_name bla; | |
| return 301 https://$server_name$request_uri; | |
| } | |
| server { | |
| listen 443 ssl; | |
| server_name bla; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mattias@cocospro:ansible (master *)$ pwd | |
| /Users/mattias/src/youtube-audio-dl/ansible | |
| mattias@cocospro:ansible (master *)$ vagrant up | |
| Bringing machine 'default' up with 'virtualbox' provider... | |
| ==> default: Box 'precise64' could not be found. Attempting to find and install... | |
| default: Box Provider: virtualbox | |
| default: Box Version: >= 0 | |
| ==> default: Adding box 'precise64' (v0) for provider: virtualbox | |
| default: Downloading: http://files.vagrantup.com/precise64.box | |
| ==> default: Successfully added box 'precise64' (v0) for 'virtualbox'! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // VirtualBox vboxsf sendfile bug workaround | |
| // use seccomp to make sendfile return ENOTSUP which makes go http fallback to io.Copy | |
| // | |
| // if running in docker make sure to give SYS_ADMIN capabilities to container: | |
| // docker create --cap-add=SYS_ADMIN | |
| // docker-compose: | |
| // cap_add: | |
| // - SYS_ADMIN | |
| // | |
| // Licensed as public domain |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package lates shairplay to /Users/Shared/xbmc-depends/tarballs/shairplay-$COMMIT.tar.bz2 | |
| tools/depends/target/libshairplay/Makefile: | |
| change VERSION=$COMMIT | |
| xbmc/network/NetworkServices.cpp: | |
| comment out "_airplay._tcp" annonucment around line ~590 | |
| do normal build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # depends: | |
| # go get golang.org/x/tools/cmd/goimports | |
| # usage: | |
| # $ goeval 'strings.SplitN("a,b,c", ",", 2)' | |
| # []string{"a", "b,c"} | |
| F="$(mktemp -t goplayXXXX).go" | |
| cat << EOF > "$F" | |
| package main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -v -s -N \ | |
| -H "Connection: Upgrade" \ | |
| -H "Upgrade: websocket" \ | |
| -H "Sec-WebSocket-Version: 13" \ | |
| -H "Sec-WebSocket-Key: dummy" \ | |
| http://host | | |
| while read -r l; do echo "${l:4}" ; done | jq . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker pull jrottenberg/ffmpeg | |
| for f in *.mp4 ; do docker run --rm -v $PWD:/files jrottenberg/ffmpeg -i /files/$f /files/${f/\.mp4/\.mp3} ; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| VAGRANTFILE_API_VERSION = "2" | |
| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
| config.vm.box = "wily" | |
| config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/wily/current/wily-server-cloudimg-amd64-vagrant-disk1.box" | |
| config.ssh.forward_agent = true | |
| config.vm.provider :virtualbox do |vb, override| | |
| vb.customize ["modifyvm", :id, "--cpus", 8] | |
| vb.customize ["modifyvm", :id, "--memory", 1024] | |
| vb.customize ["modifyvm", :id, "--ioapic", "on"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # brew install llvm --with-clang-extra-tools --with-clang | |
| /usr/local/Cellar/llvm/3.6.2/bin/clang-tidy -fix \ | |
| -fix-errors \ | |
| -header-filter=.* \ | |
| --checks=readability-braces-around-statements,misc-macro-parentheses \ | |
| *.c *.h \ | |
| -- -I. -I/usr/include |