From 04949492699865c1064e445da1904ce55e338422 Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Thu, 15 Sep 2016 02:57:03 +0000 Subject: [PATCH] Create gh-pages branch via GitHub --- index.html | 21 +++++++++++++++++---- params.json | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 34fc1c6..622cb17 100644 --- a/index.html +++ b/index.html @@ -39,6 +39,19 @@

rm -rf /

+List options current kernel was compiled with

+ +
+(Sep 14, 2016)
+ +
+Linux
+ +
zcat /proc/config.gz
+ +
+ +

Largest MySQL tables

@@ -66,7 +79,7 @@
(Apr 13, 2016)
-Linux
+Linux
screen /dev/ttyUSB0 9600
@@ -109,7 +122,7 @@
(Apr 04, 2016)
-Linux
+Linux
setxkbmap -option ctrl:nocaps
@@ -148,7 +161,7 @@
(Aug 26, 2015)
-Linux
+Linux
$ cat /proc/${PID}/environ
@@ -249,7 +262,7 @@
(Dec 4, 2014)
-Linux
+Linux
find /var/log/ -name "*log" -type f -follow | xargs tail -n 0 -f | grep -v '^$'
diff --git a/params.json b/params.json index 5568f60..e9ec476 100644 --- a/params.json +++ b/params.json @@ -1,7 +1,7 @@ { "name": "rm -rf /", "tagline": "by NeQuissimus", - "body": "# Largest MySQL tables\r\n##### (Aug 12, 2016)\r\n###### MySQL\r\n\r\n```sql\r\nSELECT CONCAT(table_schema, \".\", table_name),\r\nCONCAT(ROUND(table_rows / 1000000, 2), \"M\") rows, \r\nCONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), \"G\") DATA, \r\nCONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), \"G\") idx, \r\nCONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), \"G\") total_size, \r\nROUND(index_length / data_length, 2) idxfrac \r\nFROM information_schema.TABLES \r\nORDER BY data_length + index_length DESC \r\nLIMIT 10;\r\n```\r\n\r\n---\r\n\r\n# Screen to open serial connection\r\n##### (Apr 13, 2016)\r\n###### Linux\r\n\r\n```bash\r\nscreen /dev/ttyUSB0 9600\r\n```\r\n\r\n---\r\n\r\n# Keep processes running beyond Jenkins job\r\n##### (Apr 11, 2016)\r\n###### Jenkins\r\n\r\nIn Jenkins job:\r\n```bash\r\nexport BUILD_ID=\"dontKillMe /usr/bin/vagrant\"\r\n```\r\n\r\nSee \r\n\r\n---\r\n\r\n# Set JAVA_HOME from PATH\r\n##### (Apr 05, 2016)\r\n###### Java, Linux\r\n\r\n```bash\r\nexport JAVA_HOME=\"${$(readlink -e $(type -p java))%*/bin/java}\"\r\n```\r\n\r\n---\r\n\r\n# Disable CAPS LOCK\r\n##### (Apr 04, 2016)\r\n###### Linux\r\n\r\n```bash\r\nsetxkbmap -option ctrl:nocaps\r\n```\r\n\r\n---\r\n\r\n# Get all patch files for Git revisions\r\n##### (Nov 19, 2015)\r\n###### Git\r\n\r\n```bash\r\n$ export N=100; for i in $(git log --abbrev-commit --format=format:'%h' --all ${FILE}); do N=$((N+1)); git diff \"${i}^..${i}\" > ${N}-${i}.patch; done\r\n```\r\n\r\n---\r\n\r\n# Run specific tests in Maven\r\n##### (Nov 19, 2015)\r\n###### Maven\r\n\r\n```bash\r\n$ mvn test -Dtest=com.nequissimus.*Test\r\n```\r\n\r\n---\r\n\r\n# Environment variables for a PID\r\n##### (Aug 26, 2015)\r\n###### Linux\r\n\r\n```bash\r\n$ cat /proc/${PID}/environ\r\n```\r\n\r\n---\r\n\r\n# Revert ESXi snapshot from the CLI\r\n##### (Aug 25, 2015)\r\n###### ESXi, VMware\r\n\r\n```bash\r\n$ vim-cmd vmsvc/getallvms\r\n```\r\n\r\nVMID is the first column\r\n\r\n```bash\r\n$ vim-cmd vmsvc/snapshot.get ${VMID}\r\n```\r\n\r\nFind snapshot ID\r\n\r\n```bash\r\n$ vim-cmd vmsvc/snapshot.revert ${VMID} ${SNAPID} false\r\n```\r\n\r\n---\r\n\r\n# Grab images from Instagram app\r\n##### (Mar 31, 2015)\r\n###### Android\r\n\r\n```bash\r\n$ adb root\r\n$ mkdir ~/Downloads/instagram\r\n$ adb pull /data/data/com.instagram.android/cache ~/Downloads/instagram\r\n$ find ~/Downloads/instagram -name '*.0' -exec mv {} {}.jpg \\;\r\n$ open ~/Downloads/instagram\r\n```\r\n\r\n---\r\n\r\n# Show Mac CPU model\r\n##### (Feb 7, 2015)\r\n###### OSX\r\n\r\n```bash\r\n$ sysctl -n machdep.cpu.brand_string\r\nIntel(R) Core(TM) i7-3770S CPU @ 3.10GHz\r\n```\r\n\r\n---\r\n\r\n# Run IntelliJ IDEA without Java 1.6\r\n##### (Dec 30, 2014)\r\n###### Java, OSX\r\n\r\n- Open `/Applications/IntelliJ\\ IDEA\\ 14\\ CE.app/Contents/Info.plist`\r\n- Find `JVMVersion`\r\n- Change the value from `1.6*` to `1.8*`\r\n\r\n---\r\n\r\n# Find class file version\r\n##### (Dec 15, 2014)\r\n###### Java\r\n\r\n```bash\r\n$ od -x ~/dev/Test.class | head -1\r\n0000000 feca beba 0000 3200 4200 0007 073d 3e00\r\n```\r\n\r\nThe 3200 signals JDK 1.6, 3100 would be 1.5 etc.\r\n\r\n---\r\n\r\n# Follow log files\r\n##### (Dec 4, 2014)\r\n###### Linux\r\n\r\n```bash\r\nfind /var/log/ -name \"*log\" -type f -follow | xargs tail -n 0 -f | grep -v '^$'\r\n```\r\n\r\n---\r\n\r\n# Change JVM from command line\r\n##### (Nov 12, 2014)\r\n###### Java, OSX\r\n\r\n```bash\r\nfunction setjdk() {\r\n if [ $# -ne 0 ]; then\r\n removeFromPath '/System/Library/Frameworks/JavaVM.framework/Home/bin'\r\n if [ -n \"${JAVA_HOME+x}\" ]; then\r\n removeFromPath $JAVA_HOME\r\n fi\r\n export JAVA_HOME=`/usr/libexec/java_home -v $@`\r\n export PATH=$JAVA_HOME/bin:$PATH\r\n fi\r\n}\r\n\r\nfunction removeFromPath() {\r\n export PATH=\"$(echo \"$PATH\" | sed -E -e \"s;:$1;;\" -e \"s;$1:?;;\")\"\r\n}\r\n\r\nsetjdk 1.9\r\n```\r\n\r\n_[Source](http://www.jayway.com/2014/01/15/how-to-switch-jdk-version-on-mac-os-x-maverick/)_\r\n\r\n---\r\n\r\n# MySQL prompt\r\n##### (Nov 12, 2014)\r\n###### MySQL\r\n\r\n```bash\r\nexport MYSQL_PS1=\"\\u@\\d> \"\r\n```\r\n\r\n---\r\n\r\n# Single-line git commit history\r\n##### (Jul 28, 2014)\r\n###### git\r\n\r\n```bash\r\ngit config --global alias.lg \"log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all\"\r\n```\r\n\r\n```bash\r\ngit lg\r\n```\r\n\r\n---\r\n\r\n# Send plain-text messages via UDP\r\n##### (Jul 24, 2014)\r\n###### shell\r\n\r\n```bash\r\necho \"Test\" | socat -u STDIO UDP-DATAGRAM:127.0.0.1:514\r\n```\r\n\r\n---\r\n\r\n# Compare files with comm\r\n##### (Jul 24, 2014)\r\n###### shell\r\n\r\n```bash\r\n# First column: Lines unique to file1\r\n# Second column: Lines unique to file2\r\n# Third column: Lines common to both files\r\n$ comm file1 file2\r\n```\r\n\r\n```bash\r\n# Hide all columns (1, 2 & 3; which makes no sense!)\r\n$ comm -123 file1 file2\r\n \r\n# Only show common lines\r\n$ comm -12 file1 file2\r\n```\r\n\r\n---\r\n\r\n# Revert Subversion merge\r\n##### (Apr 16, 2014)\r\n###### Subversion\r\n\r\n```bash\r\nsvn merge -c -REVISION .\r\n```\r\n\r\n---\r\n\r\n# Send/Receive SNMP traps\r\n##### (Sep 17, 2013)\r\n###### OSX, Linux\r\n\r\n_~/.snmp/snmptrapd.conf_\r\n\r\n```bash\r\ndisableAuthorization yes\r\ncom2sec local 127.0.0.1/32 public\r\ncom2sec local 10.30.68.0/24 public\r\nview all included .1\r\n```\r\n\r\n_Start receiver_\r\n\r\n```bash\r\nsudo snmptrapd -Lf ~/.snmp/output.txt\r\n```\r\n\r\n_Send sample trap_\r\n\r\n```bash\r\nsudo snmptrap -v 2c -c public -m ALL localhost \"\" SNMPv2-MIB::sysLocation.0 s s \"Hello World\"\r\n```\r\n\r\n---\r\n\r\n# Change .NET framework in Powershell\r\n##### (Sep 17, 2013)\r\n###### Windows\r\n\r\n```xml\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n```\r\n\r\n---\r\n\r\n# Path to .NET Framework\r\n##### (Sep 17, 2013)\r\n###### Windows\r\n\r\n```powershell\r\nfunction Get-FrameworkDirectory {\r\n $([System.Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory())\r\n}\r\n```\r\n\r\n---\r\n\r\n# Copy files with progress\r\n##### (Sep 16, 2013)\r\n###### OSX, Linux\r\n\r\n```bash\r\nalias cp='rsync --progress'\r\n```\r\n\r\n---\r\n\r\n# Remove key from known_hosts\r\n##### (Sep 16, 2013)\r\n###### OSX, Linux\r\n\r\n```bash\r\nssh-keygen -R HOST\r\n```\r\n\r\n---\r\n\r\n# MySQL log\r\n##### (Sep 16, 2013)\r\n###### MySQL\r\n\r\n_my.cnf.51_\r\n\r\n```\r\nlog=/var/log/mysql/mysql.log\r\n```\r\n\r\n_my.cnf.56_\r\n\r\n```\r\ngeneral_log=true\r\ngeneral_log_file=/var/log/mysql/mysql.log\r\n```\r\n\r\n---\r\n\r\n# Prevent Spotlight indexing \r\n##### (Mar 29, 2013)\r\n###### OSX\r\n\r\n```bash\r\ntouch /Volumes/MyDrive/.metadata_never_index\r\n```\r\n\r\n---\r\n\r\n# List/Clear downloaded files list in OSX\r\n##### (Jan 19, 2013)\r\n###### OSX\r\n\r\n_List_\r\n\r\n```bash\r\nsqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV2 'select LSQuarantineDataURLString from LSQuarantineEvent'\r\n```\r\n\r\n_Empty_\r\n\r\n```bash\r\nsqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEvents* 'delete from LSQuarantineEvent'\r\n```\r\n\r\n---\r\n\r\n# Rebuild context menu entries\r\n##### (Aug 22, 2012)\r\n###### OSX\r\n\r\n```bash\r\n/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user\r\n```\r\n\r\n---\r\n\r\n# Limit bandwidth\r\n##### (Apr 19, 2012)\r\n###### OSX\r\n\r\n_Add_\r\n\r\n```bash\r\nipfw pipe 1 config bw 100KB\r\nipfw add 1 pipe 1 src-port any\r\n```\r\n\r\n_Remove_\r\n\r\n```bash\r\nipfw delete 00001\r\n```\r\n\r\n---\r\n\r\n# Headless VMware Fusion\r\n##### (Feb 17, 2012)\r\n###### OSX, VMware Fusion\r\n\r\n```bash\r\n/Library/Application\\ Support/VMware\\ Fusion/vmrun -T fusion start /Volumes/VMs/_Hadoop/Hadoop\\ Master.vmwarevm/Hadoop\\ Master.vmx nogui\r\n```\r\n\r\n---\r\n\r\n# Hide/Show ~/Library\r\n##### (Jul 21, 2011)\r\n###### OSX\r\n\r\n```bash\r\nchflags [nohidden|hidden] ~/Library\r\n```\r\n\r\n---\r\n\r\n# Force login via RDP\r\n##### (Mar 11, 2011)\r\n###### Windows\r\n\r\n```\r\nmstsc /v:123.123.123.123 /admin\r\n```\r\n\r\n---\r\n\r\n# Blank Dock.app icon\r\n##### (Feb 12, 2011)\r\n###### OSX\r\n\r\n```bash\r\ndefaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type=\"spacer-tile\";}'\r\nkillall Dock\r\n```\r\n\r\n---\r\n\r\n# Rebuild Spotlight index\r\n##### (Oct 6, 2010)\r\n###### OSX\r\n\r\n```bash\r\nsudo mdutil -E /\r\n```\r\n\r\n---\r\n\r\n# Trigger OSX maintenance scripts\r\n##### (Sep 21, 2010)\r\n###### OSX\r\n\r\n```bash\r\nsudo periodic daily weekly monthly\r\n```\r\n\r\n---", + "body": "# List options current kernel was compiled with\r\n##### (Sep 14, 2016)\r\n###### Linux\r\n\r\n```bash\r\nzcat /proc/config.gz\r\n```\r\n\r\n--- \r\n\r\n# Largest MySQL tables\r\n##### (Aug 12, 2016)\r\n###### MySQL\r\n\r\n```sql\r\nSELECT CONCAT(table_schema, \".\", table_name),\r\nCONCAT(ROUND(table_rows / 1000000, 2), \"M\") rows, \r\nCONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), \"G\") DATA, \r\nCONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), \"G\") idx, \r\nCONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), \"G\") total_size, \r\nROUND(index_length / data_length, 2) idxfrac \r\nFROM information_schema.TABLES \r\nORDER BY data_length + index_length DESC \r\nLIMIT 10;\r\n```\r\n\r\n---\r\n\r\n# Screen to open serial connection\r\n##### (Apr 13, 2016)\r\n###### Linux\r\n\r\n```bash\r\nscreen /dev/ttyUSB0 9600\r\n```\r\n\r\n---\r\n\r\n# Keep processes running beyond Jenkins job\r\n##### (Apr 11, 2016)\r\n###### Jenkins\r\n\r\nIn Jenkins job:\r\n```bash\r\nexport BUILD_ID=\"dontKillMe /usr/bin/vagrant\"\r\n```\r\n\r\nSee \r\n\r\n---\r\n\r\n# Set JAVA_HOME from PATH\r\n##### (Apr 05, 2016)\r\n###### Java, Linux\r\n\r\n```bash\r\nexport JAVA_HOME=\"${$(readlink -e $(type -p java))%*/bin/java}\"\r\n```\r\n\r\n---\r\n\r\n# Disable CAPS LOCK\r\n##### (Apr 04, 2016)\r\n###### Linux\r\n\r\n```bash\r\nsetxkbmap -option ctrl:nocaps\r\n```\r\n\r\n---\r\n\r\n# Get all patch files for Git revisions\r\n##### (Nov 19, 2015)\r\n###### Git\r\n\r\n```bash\r\n$ export N=100; for i in $(git log --abbrev-commit --format=format:'%h' --all ${FILE}); do N=$((N+1)); git diff \"${i}^..${i}\" > ${N}-${i}.patch; done\r\n```\r\n\r\n---\r\n\r\n# Run specific tests in Maven\r\n##### (Nov 19, 2015)\r\n###### Maven\r\n\r\n```bash\r\n$ mvn test -Dtest=com.nequissimus.*Test\r\n```\r\n\r\n---\r\n\r\n# Environment variables for a PID\r\n##### (Aug 26, 2015)\r\n###### Linux\r\n\r\n```bash\r\n$ cat /proc/${PID}/environ\r\n```\r\n\r\n---\r\n\r\n# Revert ESXi snapshot from the CLI\r\n##### (Aug 25, 2015)\r\n###### ESXi, VMware\r\n\r\n```bash\r\n$ vim-cmd vmsvc/getallvms\r\n```\r\n\r\nVMID is the first column\r\n\r\n```bash\r\n$ vim-cmd vmsvc/snapshot.get ${VMID}\r\n```\r\n\r\nFind snapshot ID\r\n\r\n```bash\r\n$ vim-cmd vmsvc/snapshot.revert ${VMID} ${SNAPID} false\r\n```\r\n\r\n---\r\n\r\n# Grab images from Instagram app\r\n##### (Mar 31, 2015)\r\n###### Android\r\n\r\n```bash\r\n$ adb root\r\n$ mkdir ~/Downloads/instagram\r\n$ adb pull /data/data/com.instagram.android/cache ~/Downloads/instagram\r\n$ find ~/Downloads/instagram -name '*.0' -exec mv {} {}.jpg \\;\r\n$ open ~/Downloads/instagram\r\n```\r\n\r\n---\r\n\r\n# Show Mac CPU model\r\n##### (Feb 7, 2015)\r\n###### OSX\r\n\r\n```bash\r\n$ sysctl -n machdep.cpu.brand_string\r\nIntel(R) Core(TM) i7-3770S CPU @ 3.10GHz\r\n```\r\n\r\n---\r\n\r\n# Run IntelliJ IDEA without Java 1.6\r\n##### (Dec 30, 2014)\r\n###### Java, OSX\r\n\r\n- Open `/Applications/IntelliJ\\ IDEA\\ 14\\ CE.app/Contents/Info.plist`\r\n- Find `JVMVersion`\r\n- Change the value from `1.6*` to `1.8*`\r\n\r\n---\r\n\r\n# Find class file version\r\n##### (Dec 15, 2014)\r\n###### Java\r\n\r\n```bash\r\n$ od -x ~/dev/Test.class | head -1\r\n0000000 feca beba 0000 3200 4200 0007 073d 3e00\r\n```\r\n\r\nThe 3200 signals JDK 1.6, 3100 would be 1.5 etc.\r\n\r\n---\r\n\r\n# Follow log files\r\n##### (Dec 4, 2014)\r\n###### Linux\r\n\r\n```bash\r\nfind /var/log/ -name \"*log\" -type f -follow | xargs tail -n 0 -f | grep -v '^$'\r\n```\r\n\r\n---\r\n\r\n# Change JVM from command line\r\n##### (Nov 12, 2014)\r\n###### Java, OSX\r\n\r\n```bash\r\nfunction setjdk() {\r\n if [ $# -ne 0 ]; then\r\n removeFromPath '/System/Library/Frameworks/JavaVM.framework/Home/bin'\r\n if [ -n \"${JAVA_HOME+x}\" ]; then\r\n removeFromPath $JAVA_HOME\r\n fi\r\n export JAVA_HOME=`/usr/libexec/java_home -v $@`\r\n export PATH=$JAVA_HOME/bin:$PATH\r\n fi\r\n}\r\n\r\nfunction removeFromPath() {\r\n export PATH=\"$(echo \"$PATH\" | sed -E -e \"s;:$1;;\" -e \"s;$1:?;;\")\"\r\n}\r\n\r\nsetjdk 1.9\r\n```\r\n\r\n_[Source](http://www.jayway.com/2014/01/15/how-to-switch-jdk-version-on-mac-os-x-maverick/)_\r\n\r\n---\r\n\r\n# MySQL prompt\r\n##### (Nov 12, 2014)\r\n###### MySQL\r\n\r\n```bash\r\nexport MYSQL_PS1=\"\\u@\\d> \"\r\n```\r\n\r\n---\r\n\r\n# Single-line git commit history\r\n##### (Jul 28, 2014)\r\n###### git\r\n\r\n```bash\r\ngit config --global alias.lg \"log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all\"\r\n```\r\n\r\n```bash\r\ngit lg\r\n```\r\n\r\n---\r\n\r\n# Send plain-text messages via UDP\r\n##### (Jul 24, 2014)\r\n###### shell\r\n\r\n```bash\r\necho \"Test\" | socat -u STDIO UDP-DATAGRAM:127.0.0.1:514\r\n```\r\n\r\n---\r\n\r\n# Compare files with comm\r\n##### (Jul 24, 2014)\r\n###### shell\r\n\r\n```bash\r\n# First column: Lines unique to file1\r\n# Second column: Lines unique to file2\r\n# Third column: Lines common to both files\r\n$ comm file1 file2\r\n```\r\n\r\n```bash\r\n# Hide all columns (1, 2 & 3; which makes no sense!)\r\n$ comm -123 file1 file2\r\n \r\n# Only show common lines\r\n$ comm -12 file1 file2\r\n```\r\n\r\n---\r\n\r\n# Revert Subversion merge\r\n##### (Apr 16, 2014)\r\n###### Subversion\r\n\r\n```bash\r\nsvn merge -c -REVISION .\r\n```\r\n\r\n---\r\n\r\n# Send/Receive SNMP traps\r\n##### (Sep 17, 2013)\r\n###### OSX, Linux\r\n\r\n_~/.snmp/snmptrapd.conf_\r\n\r\n```bash\r\ndisableAuthorization yes\r\ncom2sec local 127.0.0.1/32 public\r\ncom2sec local 10.30.68.0/24 public\r\nview all included .1\r\n```\r\n\r\n_Start receiver_\r\n\r\n```bash\r\nsudo snmptrapd -Lf ~/.snmp/output.txt\r\n```\r\n\r\n_Send sample trap_\r\n\r\n```bash\r\nsudo snmptrap -v 2c -c public -m ALL localhost \"\" SNMPv2-MIB::sysLocation.0 s s \"Hello World\"\r\n```\r\n\r\n---\r\n\r\n# Change .NET framework in Powershell\r\n##### (Sep 17, 2013)\r\n###### Windows\r\n\r\n```xml\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n```\r\n\r\n---\r\n\r\n# Path to .NET Framework\r\n##### (Sep 17, 2013)\r\n###### Windows\r\n\r\n```powershell\r\nfunction Get-FrameworkDirectory {\r\n $([System.Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory())\r\n}\r\n```\r\n\r\n---\r\n\r\n# Copy files with progress\r\n##### (Sep 16, 2013)\r\n###### OSX, Linux\r\n\r\n```bash\r\nalias cp='rsync --progress'\r\n```\r\n\r\n---\r\n\r\n# Remove key from known_hosts\r\n##### (Sep 16, 2013)\r\n###### OSX, Linux\r\n\r\n```bash\r\nssh-keygen -R HOST\r\n```\r\n\r\n---\r\n\r\n# MySQL log\r\n##### (Sep 16, 2013)\r\n###### MySQL\r\n\r\n_my.cnf.51_\r\n\r\n```\r\nlog=/var/log/mysql/mysql.log\r\n```\r\n\r\n_my.cnf.56_\r\n\r\n```\r\ngeneral_log=true\r\ngeneral_log_file=/var/log/mysql/mysql.log\r\n```\r\n\r\n---\r\n\r\n# Prevent Spotlight indexing \r\n##### (Mar 29, 2013)\r\n###### OSX\r\n\r\n```bash\r\ntouch /Volumes/MyDrive/.metadata_never_index\r\n```\r\n\r\n---\r\n\r\n# List/Clear downloaded files list in OSX\r\n##### (Jan 19, 2013)\r\n###### OSX\r\n\r\n_List_\r\n\r\n```bash\r\nsqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV2 'select LSQuarantineDataURLString from LSQuarantineEvent'\r\n```\r\n\r\n_Empty_\r\n\r\n```bash\r\nsqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEvents* 'delete from LSQuarantineEvent'\r\n```\r\n\r\n---\r\n\r\n# Rebuild context menu entries\r\n##### (Aug 22, 2012)\r\n###### OSX\r\n\r\n```bash\r\n/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user\r\n```\r\n\r\n---\r\n\r\n# Limit bandwidth\r\n##### (Apr 19, 2012)\r\n###### OSX\r\n\r\n_Add_\r\n\r\n```bash\r\nipfw pipe 1 config bw 100KB\r\nipfw add 1 pipe 1 src-port any\r\n```\r\n\r\n_Remove_\r\n\r\n```bash\r\nipfw delete 00001\r\n```\r\n\r\n---\r\n\r\n# Headless VMware Fusion\r\n##### (Feb 17, 2012)\r\n###### OSX, VMware Fusion\r\n\r\n```bash\r\n/Library/Application\\ Support/VMware\\ Fusion/vmrun -T fusion start /Volumes/VMs/_Hadoop/Hadoop\\ Master.vmwarevm/Hadoop\\ Master.vmx nogui\r\n```\r\n\r\n---\r\n\r\n# Hide/Show ~/Library\r\n##### (Jul 21, 2011)\r\n###### OSX\r\n\r\n```bash\r\nchflags [nohidden|hidden] ~/Library\r\n```\r\n\r\n---\r\n\r\n# Force login via RDP\r\n##### (Mar 11, 2011)\r\n###### Windows\r\n\r\n```\r\nmstsc /v:123.123.123.123 /admin\r\n```\r\n\r\n---\r\n\r\n# Blank Dock.app icon\r\n##### (Feb 12, 2011)\r\n###### OSX\r\n\r\n```bash\r\ndefaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type=\"spacer-tile\";}'\r\nkillall Dock\r\n```\r\n\r\n---\r\n\r\n# Rebuild Spotlight index\r\n##### (Oct 6, 2010)\r\n###### OSX\r\n\r\n```bash\r\nsudo mdutil -E /\r\n```\r\n\r\n---\r\n\r\n# Trigger OSX maintenance scripts\r\n##### (Sep 21, 2010)\r\n###### OSX\r\n\r\n```bash\r\nsudo periodic daily weekly monthly\r\n```\r\n\r\n---", "google": "UA-31449022-1", "note": "Don't delete this file! It's used internally to help with page regeneration." } \ No newline at end of file