\copy (select username from auth_user order by date_joined desc limit 10000) to 'latest-users.csv' with csv;
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 sys | |
SPEED_PER_HOUR = { | |
'fast': 4, # miles | |
'normal': 3, | |
'slow': 2, | |
} | |
TRAVEL_TIME_PER_DAY = { |
Update apt index
apt-get update
Extract package into directory
dpkg-deb -x mypackage.deb dstDir
Find installed packages
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
1. Python code compiles to bytecode which can not run concurrently | |
2. GIL protects:, reference count updates, mutable types, some internal bookkeeping | |
3. Can't use threads | |
4. Python instructions are not interruptible |
Due to the incessant swarm of complete and utter nonsense that has been forcing its way into Firefox over time, I've decided to start collecting my personal list of “must-have” about:config tweaks required to turn Firefox into a functional brower.
NOTE: Unfortunately this is somewhat out of date. The comments link to some resources that may be more up-to-date. Patches welcome.
These can be used for nefarious purposes and to bypass access restrictions.
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 | |
# pdiff: colorized diffs for linux p4 workspaces | |
# usage: pdiff <CL#> | |
p4 opened -c $1 | sed -e 's/#.*//' | p4 -x - diff -du | colordiff |
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
-- filter by table name | |
select indexrelname, idx_scan, idx_tup_read, idx_tup_fetch from pg_stat_user_indexes where relname = '<TABLE NAME>'; | |
-- filter by index name | |
select idx_scan, idx_tup_read, idx_tup_fetch from pg_stat_user_indexes where indexrelname = '<IDX NAME>'; |
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
/-+\~_. |
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 static android.opengl.GLES20.GL_COMPILE_STATUS; | |
import static android.opengl.GLES20.GL_FRAGMENT_SHADER; | |
import static android.opengl.GLES20.GL_LINK_STATUS; | |
import static android.opengl.GLES20.GL_VALIDATE_STATUS; | |
import static android.opengl.GLES20.GL_VERTEX_SHADER; | |
import static android.opengl.GLES20.glAttachShader; | |
import static android.opengl.GLES20.glCompileShader; | |
import static android.opengl.GLES20.glCreateProgram; | |
import static android.opengl.GLES20.glCreateShader; | |
import static android.opengl.GLES20.glDeleteProgram; |
NewerOlder