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 | |
# This scripts pops up a notification in X if your RAM is occupied more | |
# than a certain value (default: 90%). | |
# Memory is checked every 30 seconds. | |
checkmemory () { | |
while | |
sleep 30 | |
FREE=`free -tw | grep Mem | tr -s ' ' | cut -d ' ' -f 4` | |
USED=`free -tw | grep Mem | tr -s ' ' | cut -d ' ' -f 3` |
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
# http://stackoverflow.com/questions/6491532/how-to-subset-a-file-select-a-numbers-of-rows-or-columns | |
cat largefile | awk 'NR >= 10000 && NR <= 100000 { print }' |
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
The first draft is for the writer. The second draft is for the editor. The last draft is for the reader. | |
Emphasize how much work you have ahead of you to make this a good book. | |
Only a good writer would be able to say that. | |
If you would only defer to the narrative, you could get away with murder. | |
Most mysterious of all is the hidden middle stage, the offstage act of editing. | |
The first draft is for the writer. The second draft is for the editor. The last draft is for the reader. |
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
Move a group of components around a schematic: | |
move (>0 0) (0 -0.5); | |
Generate statistics of a board: | |
run length-freq-ri | |
Smash all & Change the typeface, ratio, and size of all elements: | |
group all; smash (> 0 0); change font vector (>0 0); change ratio 8 (>0 0); change size 0.07 (>0 0); |
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
ls -v | cat -n | while read n f; do mv -n "$f" "$n.png"; convert "$n.png" "$n.pdf"; 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
import wmi | |
c = wmi.WMI() | |
t = wmi.WMI(moniker = "//./root/wmi") | |
batts1 = c.CIM_Battery(Caption = 'Portable Battery') | |
for i, b in enumerate(batts1): | |
print 'Battery %d Design Capacity: %d mWh' % (i, b.DesignCapacity or 0) | |
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
[ | |
{ | |
"id": "f1ffeb7e.f6451", | |
"type": "http in", | |
"z": "c29865fe.249648", | |
"name": "", | |
"url": "/upload", | |
"method": "get", | |
"upload": false, | |
"swaggerDoc": "", |
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
# journalctl --disk-usage | |
journalctl --vacuum-size=50M | |
journalctl --vacuum-time=10d | |
echo SystemMaxUse=500M | tee -a /etc/systemd/journald.conf |
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 statement_timeout TO 1200000; | |
-- | |
\COPY (SELECT * FROM "traccar"."tc_devices" ORDER BY "id" ASC) TO '/goodenough_0/devices.csv' WITH CSV DELIMITER ',' HEADER QUOTE '"' ESCAPE ''''; | |
\COPY (SELECT * FROM "traccar"."tc_users" ORDER BY "id" ASC) TO '/goodenough_0/users.csv' WITH CSV DELIMITER ',' HEADER QUOTE '"' ESCAPE ''''; | |
\COPY (SELECT * FROM "traccar"."tc_positions" ORDER BY "id" ASC) TO '/goodenough_0/positions.csv' WITH CSV DELIMITER ',' HEADER QUOTE '"' ESCAPE ''''; | |
-- |