This file contains 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
<?php | |
$server = "localhost"; | |
$port = 11211; | |
function sendMemcacheCommand($server,$port,$command){ | |
$s = @fsockopen($server,$port); | |
if (!$s){ | |
die("Cant connect to:".$server.':'.$port); |
This file contains 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
<?php | |
class mysql_profile | |
{ | |
/** | |
* @var bool | |
*/ | |
var $backtrace = false; | |
/** | |
* @var array |
This file contains 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 | |
# сhange the bs=value to speed up and increase the sizes of the bold and non-bold strings. | |
echo -ne "\e[32m" ; while true ; do echo -ne "\e[$(($RANDOM % 2 + 1))m" ; tr -c "[:print:]" " " < /dev/urandom | dd count=1 bs=50 2> /dev/null ; done |
This file contains 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
SELECT CONCAT('ALTER TABLE ', table_name, ' ENGINE=InnoDB;') as ExecuteTheseSQLCommands | |
FROM information_schema.tables WHERE table_schema = 'name_of_your_db' | |
ORDER BY table_name DESC; |
This file contains 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 into .htaccess or virtual host | |
RewriteEngine On | |
RewriteCond %{REQUEST_URI} !\.php$ | |
RewriteRule ^(.+)$ $1.php |
This file contains 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
<?php | |
mysql_query("set profiling_history_size=100"); | |
mysql_query("set profiling=1"); | |
# | |
# your queries here | |
# | |
$rs = mysql_query("show profiles"); | |
while($rd = mysql_fetch_object($rs)) |
This file contains 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
MAXJOBS=20 | |
for i in `seq 1 $MAXJOBS` ; do nice -n 19 gzip -c /dev/zero > /dev/null & done | |
while true | |
do | |
LA=`</proc/loadavg` && LA=${LA// */} | |
H=$(date +%M) && H=${H/0/} | |
G=`echo "(${MAXJOBS}/2)*(s(2*3.14159*${H}/60) +1 ) <= ${LA}" | bc -l` | |
test ${G} -lt 1 && for i in `seq 1 $MAXJOBS` ; do kill -SIGCONT %$i ; done || for i in `seq 1 $MAXJOBS` ; do kill -SIGSTOP %$i; done | |
sleep 1 |
This file contains 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
[cmdletbinding()] | |
param( | |
[string]$Width, | |
[string]$Height, | |
[string]$datestamp = "{0:HH/mm/ss/dd/MM/yyyy}" -f (get-date), | |
[string]$FileName = $env:COMPUTERNAME + "_screen_" + "$datestamp" | |
) | |
function Take-Screenshot{ | |
[cmdletbinding()] |
This file contains 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
# install soft | |
$soft = ['wget', 'curl', 'zsh', 'cowsay', 'fortune', 'strace', | |
'sudo', 'mc', 'make', 'gcc', 'tree', 'ntpdate', 'dh-make', | |
'debhelper', 'devscripts', 'fakeroot', 'openjdk-7-jdk', 'git', | |
'storm', 'vim', 'md5deep', 'dpkg', 'debconf', 'lintian'] | |
apt::source { 'edisoft': | |
location => 'http://10.20.20.75:8080/static/edisoft', | |
release => 'wheezy', | |
repos => 'main', | |
key => 'D5EFD011', |
This file contains 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
fix for hotkeys not functional in non-latin keyboard layout in 13.10 / 14.04 | |
tested on ubuntu 14.04, jvm7 and rubymine 6.3 | |
sudo add-apt-repository ppa:attente/java-non-latin-shortcuts | |
sudo apt-get update | |
sudo apt-get dist-upgrade | |
restart unity-settings-daemon | |
now ctrl+c, ctrl-v etc should work in most java applications like IDEA, RubyMine IDE even on russian keyboard layout |
OlderNewer