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
ffmpeg -i video_file_name.ext -r 1 image-%04d.jpeg # creates a jpeg for every second of a video |
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 | |
/** | |
* source: https://jameshd.wordpress.com/2014/11/12/slow-phpunit-tests/ | |
*/ | |
class TestTimesListener implements PHPUnit_Framework_TestListener | |
{ | |
/** | |
* Anything above this threshold is deemed slow | |
* @var float $seconds |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
$ mysql -u root -p | |
mysql> create database mogilefs; | |
mysql> grant all on mogilefs.* to 'mogile'@'%' identified by 'mogilepw'; | |
mysql> flush privileges; | |
mysql> quit | |
$ mogdbsetup --yes --dbname=mogilefs --dbuser=mogile --dbpassword=mogilepw | |
$ cat > /etc/mogilefs/mogilefsd.conf <<EOF | |
daemonize = 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
rabbitmqctl list_connections pid port state user vhost recv_cnt send_cnt send_pend name | awk '{print "rabbitmqctl close_connection \"" $1 "\" \"manually closing idle connection\"" | "/bin/bash" }' |
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
| awk 'BEGIN { OFS = ","} { printf $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
# ignore | |
git update-index --assume-unchanged <file> | |
# stop ignoring | |
git update-index --no-assume-unchanged <file> |
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
SET AUTOCOMMIT=0; | |
SET UNIQUE_CHECKS=0; | |
SET FOREIGN_KEY_CHECKS=0; | |
-- DUMP HERE | |
SET FOREIGN_KEY_CHECKS=1; | |
SET UNIQUE_CHECKS=1; | |
SET AUTOCOMMIT=1; | |
COMMIT; |
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 table_name AS "table", | |
round(((data_length + index_length) / 1024 / 1024 / 1024), 5) "GB" | |
FROM information_schema.TABLES | |
WHERE table_schema = "database-name" | |
ORDER BY GB 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
# daemontools on centos 5 | |
# based on http://cr.yp.to/daemontools/install.html | |
# install | |
mkdir -p /package && chmod 1755 /package && cd /package | |
wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz | |
gunzip daemontools-0.76.tar && tar -xpf daemontools-0.76.tar && cd admin/daemontools-0.76 | |
# centos 5 fix | |
echo 'gcc -include /usr/include/errno.h -O2 -Wimplicit -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wcast-qual -Wcast-align -Wwrite-strings' > src/conf-cc |