Skip to content

Instantly share code, notes, and snippets.

View pyprism's full-sized avatar
🪐
exploring universe

Ashutosh Das pyprism

🪐
exploring universe
View GitHub Profile
@pyprism
pyprism / fstab
Created April 22, 2023 02:17
fstab contents, move cache, temporary files to tmpfs
tmpfs /tmp tmpfs nodev,nosuid,size=28G 0 0
tmpfs /var/log tmpfs nodev,nosuid,size=1G 0 0
tmpfs /var/cache/apt/archives tmpfs nodev,nosuid,size=2G 0 0
tmpfs /home/prism/.cache/google-chrome tmpfs nodev,nosuid,size=1G 0 0
tmpfs /home/prism/.cache/ tmpfs nodev,nosuid,size=2G 0 0
tmpfs /home/prism/.npm/ tmpfs nodev,nosuid,size=2G 0 0
tmpfs /home/prism/.yarn/ tmpfs nodev,nosuid,size=1G 0 0
tmpfs /home/prism/.gradle tmpfs nodev,nosuid,size=10G 0 0
tmpfs /home/prism/.config/WarThunder/.game_logs tmpfs nodev,nosuid,size=1G 0 0
tmpfs /var/lib/docker/ tmpfs nodev,nosuid,size=20G 0 0
@pyprism
pyprism / gist:d03e5168e9c7aa8d6adf25ac034e7aa0
Created February 23, 2019 03:49
A quick/dirty top 20 list of your slowest, or biggest, or hardest on the cpu queries. (Postgres)
SELECT query
, calls
, total_time
, total_time / calls as time_per
, stddev_time
, rows
, rows / calls as rows_per
,100.0 * shared_blks_hit / nullif(shared_blks_hit + shared_blks_read, 0) AS hit_percent
FROM pg_stat_statements
WHERE query not similar to '%pg_%'
%A, %l:%M:%S %p, %e/%m/%Y
@pyprism
pyprism / gist:ae32816a722a997ece5840c55c1e99ce
Last active February 20, 2017 04:02
Find most used shell commands in zsh
fc -li -146 | awk '{print $4}' | sort | uniq -c
@pyprism
pyprism / Nginx
Created May 12, 2016 15:16
Nginx SSL conf
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_ecdh_curve secp384r1; # Requires nginx >= 1.1.0
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off; # Requires nginx >= 1.5.9
ssl_stapling on; # Requires nginx >= 1.3.7
ssl_stapling_verify on; # Requires nginx => 1.3.7
resolver $DNS-IP-1 $DNS-IP-2 valid=300s;
resolver_timeout 5s;
@pyprism
pyprism / hiren.sh
Created March 7, 2016 15:43
bash one liner compose music
cat /dev/urandom | hexdump -v -e '/1 "%u\n"' | awk '{ split("0,2,4,5,7,9,11,12",a,","); for (i = 0; i < 1; i+= 0.0001) printf("%08X\n", 100*sin(1382*exp((a[$1 % 8]/12)*log(2))*i)) }' | xxd -r -p | aplay -c 2 -f S32_LE -r 16000
@pyprism
pyprism / gist:fdeb15a5a35ed26b645c
Created March 3, 2016 03:34
Mirroring web documentation using wget
wget -r -l5 -k -np -p https://docs.python.org/2/
Don't worry, that value is only wrong half of the time
The unit test doesn't cover that eventuality
There was too little data to bother with the extra functionality at the time
I thought you signed off on that?
The program has never collected that information
That's interesting, how did you manage to make it do that?
Your browser must be caching the old content
Our internet connection must not be working
I couldn't find any examples of how that can be done anywhere online
I thought I fixed that
@pyprism
pyprism / fb
Created February 3, 2015 13:42
fb object
object(Facebook\GraphObject)[5]
protected 'backingData' =>
array (size=3)
'data' =>
array (size=25)
0 =>
object(stdClass)[9]
...
1 =>
object(stdClass)[65]

Keybase proof

I hereby claim:

  • I am pyprism on github.
  • I am pyprism (https://keybase.io/pyprism) on keybase.
  • I have a public key whose fingerprint is F946 D0F1 8A1D 840C 1D8E 94FC 3A85 09FD B81F B2BB

To claim this, I am signing this object: