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
| echo “10152 65535″ > /proc/sys/net/ipv4/ip_local_port_range | |
| sysctl -w fs.file-max=128000 | |
| sysctl -w net.ipv4.tcp_keepalive_time=300 | |
| sysctl -w net.core.somaxconn=250000 | |
| sysctl -w net.ipv4.tcp_max_syn_backlog=2500 | |
| sysctl -w net.core.netdev_max_backlog=2500 | |
| ulimit -n 10240 |
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
| import commands | |
| from fabric.api import * | |
| # Globals | |
| env.project='EBSSTRIPING' | |
| env.user = 'myuser' | |
| DEVICES = [ |
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(window,undefined){ | |
| var document = window.document; | |
| var self = { | |
| map: undefined, | |
| elem: undefined, | |
| load: function( elem ) { | |
| self.elem = elem; | |
| if( self.is_loaded ) { return; } | |
| var callback = "window.gmap.load_cb" | |
| var s = document.createElement("script"); |
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
| $("head").append("<link>"); | |
| css = $("head").children(":last"); | |
| css.attr({ | |
| rel: "stylesheet", | |
| type: "text/css", | |
| href: "/javascripts/jwysiwyg/jquery.wysiwyg.css" | |
| }); |
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
| Put these in /etc/sysctl.conf then run sysctl -p to apply them. | |
| # General gigabit tuning: | |
| net.core.rmem_max = 16777216 | |
| net.core.wmem_max = 16777216 | |
| net.ipv4.tcp_rmem = 4096 87380 16777216 | |
| net.ipv4.tcp_wmem = 4096 65536 16777216 | |
| net.ipv4.tcp_syncookies = 1 | |
| # this gives the kernel more memory for tcp |
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
| String json_q( String s ) { | |
| return s.replaceAll( "\\\\", "\\\\\\\\" ).replaceAll( "\"", "\\\\\"" ); | |
| } |
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
| gpsbabel -w -t -i garmin -f /dev/ttyS0 -o kml -F output.kml |
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
| 1) git svn clone svn://url/ | |
| 2) git checkout -b local | |
| 3) git add/commit/add/commit/.... | |
| 4) git checkout master | |
| 5) git svn rebase | |
| 6) git checkout local | |
| 7) git merge --no-ff master | |
| 8) fix conflicts/git add/git commit -a | |
| 9) git checkout master | |
| 10) git svn rebase |
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/env python | |
| import memcache | |
| import random | |
| import time | |
| mc = memcache.Client(["127.0.0.1:11211"]) | |
| pc = {} | |
| data = dict( a="abc", b=["def",123,('1','2')] ) |
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
| [i+2 for i, numberList in enumerate([[i for x in range(2, i+1) if i % x == 0 and i != x] for i in range(2,100)]) if not numberList] |