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
| root@tel1:/etc/network# id | |
| uid=0(root) gid=0(root) groups=0(root) | |
| root@tel1:/etc/network# rm -f interfaces | |
| rm: cannot remove `interfaces': Operation not permitted | |
| root@tel1:/etc/network# ls -halps interfaces | |
| 4.0K -rw-r--r-- 1 root root 285 Jul 10 2011 interfaces |
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 | |
| # For the duration of this script, don’t run .rvmrcs | |
| unset rvm_project_rvmrc | |
| orig_pwd=$PWD | |
| find . -name '*.git' -type d | while read repo; do | |
| # Starts a subshell, and thereby resetting pwd every time | |
| cd "$orig_pwd/$repo" |
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
| (defn wait-a-bi [] | |
| (do (println "waiting a bit") | |
| (. Thread (sleep 200)))) | |
| (first ((wait-a-bit) (wait-a-bit)) |
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
| (defn run-process | |
| "Runs the process" | |
| [args] | |
| (->> | |
| (new ProcessBuilder args) | |
| (.start) | |
| )) | |
| (defn exec | |
| "Returns the ouput of the command, which is assumed to smallish and non-binary." |
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
| daemon off; | |
| pid /tmp/nginx-80-to-8888.pid; | |
| events { | |
| worker_connections 102480; | |
| multi_accept on; | |
| } | |
| http { | |
| server { |
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
| var http = require('http'); | |
| var server = http.createServer(function (req, res) { | |
| res.end('hullo'); | |
| }); | |
| server.listen(1250, function () { | |
| console.log('Listening on 1250'); | |
| }); |
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
| Shut down the computer. | |
| - Plug in the MagSafe power adapter to a power source, connecting it to the Mac if its not already connected. | |
| - On the built-in keyboard, press the (left side) Shift-Control-Option keys and the power button at the same time. | |
| - Release all the keys and the power button at the same time. | |
| - Press the power button to turn on the computer. | |
| Note: The LED on the MagSafe power adapter may change states or temporarily turn off when you reset the SMC. |
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 | |
| set -e | |
| difftool=diff | |
| [[ -f /usr/local/bin/ksdiff ]] && difftool=ksdiff | |
| lname=$(echo $1 | tr '/' '-') | |
| rname=$(echo $2 | tr '/' '-') |
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
| def transformKeys[A,B,C](m: Map[A, B], transformFunc: (A => C)): Map[C, B] = { | |
| m.foldLeft(Map.empty[C, B]) { (acc, entry) => | |
| acc + (transformFunc(entry._1) -> entry._2) | |
| } | |
| } | |
| val numMap: Map[Int, String] = Map(1 -> "Two", 2 -> "Four", 3 -> "Six") | |
| val transformed = transformKeys(numMap, { (key:Int) => key * 2 }) | |
| // without (key:Int) = error: missing parameter type |
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
| function jdk7 () { | |
| export JVM_VERSION='1.7.0_51' | |
| # Java | |
| export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk${JVM_VERSION}.jdk/Contents/Home" | |
| export PATH="${JAVA_HOME}/bin:${PATH}" | |
| } | |
| function jdk8 () { | |
| export JVM_VERSION='1.8.0_20' |