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 want to leave electronics plugged in the outlets without worrying about they're using unnecessary electricity. | |
Idea: | |
Place an electricity controller in-between the breakers and the rest of the wires going to the outlets. | |
This controller will serve as a relay switch that let current pass in certain conditions (e.g. time of the day, demand, etc). | |
I don't need the switching mechanism to be per outlet. Usually, breakers distribution are well made and a relay for every breaker will do just fine for my needs. During the day all house outlets should be off minus the one affecting the fridge. Rest of them I want them to be turned on, initially, by demand. | |
What's out there? | |
Home Automation outlets | |
Smart outlets |
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
ssh host "cat file.log" | awk -v re="*" '$0 ~ re {print $1}' |
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
$ cat /dev/null > ~/.bash_history && history -c && exit |
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
-- Stop query | |
SELECT pg_cancel_backend(pid of the postgres process); | |
-- Get the type of the column | |
SELECT pg_typeof(column); | |
-- Get locks on 'relation' | |
SELECT locks.relation::regclass, | |
locks.mode, |
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
$ ssh server "forever list | awk 'NR <= 2 {next} \$3 "\!"~ /something-i-dont-want/ {print \$3}' | xargs -L1 forever restart" |
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 bunyan = require('bunyan'); | |
var logger = bunyan.createLogger({ | |
name: 'myapp', | |
serializers: bunyan.stdSerializers | |
}); | |
// When using standard serializers, an Error object can be passed in "err" | |
logger.fatal({err: new Error('Something wrong'), payload: payload}, 'Ooops'); | |
// The simplest |
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
$ kill -9 `ps -ef | grep oraxpo | grep -v grep | awk '{print $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
ssh user@host -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no |
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
-- In psql | |
UPDATE jobs | |
SET isRunning = true | |
WHERE | |
id IN ( | |
SELECT id | |
FROM jobs | |
WHERE | |
providerid = "foo" AND |
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
time wget http://www.aip.im -q --output-document=/dev/null | |
# See more at: http://www.aip.im/2012/05/how-to-measure-web-sites-response-time-with-wget/#sthash.rNHN1Dyp.dpuf |