Create this file (be sure to set chmod +x
on it) /etc/NetworkManager/dispatcher.d/99-wlan-disable
Here is what should be in the file:
#!/bin/bash
wired_interfaces="en.*|eth.*"
if [[ "$1" =~ $wired_interfaces ]]; then
case "$2" in
up)
nmcli radio wifi off
;;
down)
nmcli radio wifi on
;;
esac
fi
Decrypting (android) mobile bitcoin wallet backups
I wanted to move some coins around with the recent Bitcoin Cash hard fork and needed to decrypt my private keys from my android wallet. After trying to mess around with a command I found online:
openssl enc -d -aes-256-cbc -a -in bitcoin-wallet-backup-2017-08-14 -out bitcoin-wallet-backup-2017-08-14.decrypted enter aes-256-cbc decryption password: bad decrypt 140383167771904:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:../crypto/evp/evp_enc.c:535:
I finally found the correct command in the source repo for the wallet. Here’s what you really want to run:
openssl enc -d -aes-256-cbc -md md5 -a -in bitcoin-wallet-backup-2017-08-14 -out bitcoin-wallet-backup-2017-08-14.decrypted
Building a new desktop PC
So, I’m building a new desktop and thought I’d drop my shopping list here….
- Intel – Core i5-7600 3.5GHz Quad-Core Processor – $209
- Coolermaster Hyper 212 Evo RR-212E-20PK-R2 120 mm Case Fan – 600-2000 RPM
- Gigabyte – GA-Z270-HD3P ATX LGA1151 Motherboard – $119
- Corsair – Vengeance LPX 8GB (1 x 8GB) DDR4-2400 Memory – $62 x 2
- Samsung – 960 EVO 500GB M.2-2280 Solid State Drive – $220
Corsair Power Supply – 760W 80+ Platinum Certified Fully-Modular ATX – $150 - GPU – GTX 1080 Ti
- Corsair Memory CC-9011035-WW Obsidian Series 750D Full Tower ATX Case – $199
(change for Corsair Memory Obsidian Series 750D – Airflow Edition ) - Samsung MZ-V6E250BW 960 EVO MZ-V6E250BW – Solid state drive – encrypted – 250 GB – internal – M.2 2280 – PCI Express 3.0 x4 (NVMe) – 256-bit AES – TCG Opal Encr ( needs to be 500GB+) or from here
New usbguard PPA for Ubuntu 16.04
usbguard is a project that prevents authorized USB devices from connecting to your Linux system.
So, here’s my first stab at creating a public PPA for Ubuntu 16.04:
USBguard PPA
From this project:
usbguard
More NFA Fun Data by state
Inspired by this post, NFA Fun Data by state, and feeling that Utah was underrepresented, I crunched some per-capita numbers using the census estimated populations for 2014. Here are the top states for each section (per 10,000 people):
Top state for Machine Guns: Connecticut at 74 per 10k people
Top state for Silencers: Utah at 171 per 10k people
Top state for Destructive Devices: Wyoming at 2,022 per 10k people (D.C. is #2 at 583)
Top state for Short Barreled Rifle: New Hampshire at 21 per 10k people
Top state for Short Barreled Shotguns: Alaska at 16.9 per 10k people (D.C. a close 2nd place at 16.6)
Top state for Any Other Weapons: Wyoming at 5 per 10k people
Top state for FFLs: Wyoming at 15.3 per 10k people (Montana a close 2nd place at 15.2)
Utah made the list!
I must admit that I was initially surprised to see D.C near the top of the lists, but I suspect that it is due to Law Enforcement Agencies. It is interesting to note that D.C. only has 25 FFLs. Also, I have no idea why there are so many destructive devices per person in Wyoming.
Original data source ATF’s Firearms commerce in the USA
My formatted data is here and here
Turn off baloo in Kubuntu 14.04
baloo is a performance killer in Kubuntu so I wanted it off. Here’s how:
Edit $HOME/.kde/share/config/baloofilerc
Change the following line (or add it if it’s not there):
Indexing-Enabled=false
Partial solar eclipse
Error/Fix: “Decryption failed” when importing a p12 certificate into Kleopatra
Run a shell script with setuid
Linux has protections in place to prevent you from running shell scripts with root permissions that have the setuid bit set.
But there’s a way to work around that. (yay! but also be careful!)
You’ll need to create a binary with setuid on it…. Here’s how to create the binary:
Create the your C file (somefile.c)
#include#include #include #include int main() { setuid( 0 ); system( "/yourpath/to/yourscript.bash" ); return 0; }
Compile it:
gcc somefile.c -o somefile
Set permissions on it:
chown root:root somefile
chmod 4755 somefile
Error/Fix: OOM (out of memory) killer kills mysqld every time!
Error (or undesired behavior, in this case): Out of Memory killer kills mysqld when memory runs low. I’d rather have it kill apache processes instead.
Fix: specifically exclude OOM from killing the mysqld process with:
echo -17 > /proc/`cat /var/run/mysqld/mysqld.pid`/oom_adj