Skip to content

Instantly share code, notes, and snippets.

View ethicnology's full-sized avatar
🐧
🧅

J. Azad EMERY ethicnology

🐧
🧅
View GitHub Profile
@ethicnology
ethicnology / ufw.md
Last active July 28, 2024 18:06
ufw

ufw

sudo bash << EOF
ufw --force reset
ufw default deny incoming
ufw default deny outgoing
ufw limit 22                  # ssh
ufw allow out 53              # dns
ufw allow out 80 # http
@ethicnology
ethicnology / mdadm.txt
Last active April 20, 2022 06:49
mdadm
```
mdadm --detail /dev/mdX
```
```
mdadm --stop /dev/mdX
```
```
mdadm --assemble --force /dev/mdX /dev/sda /dev/sdb /dev/sdc /dev/sdd
@ethicnology
ethicnology / elements.sh
Last active March 19, 2022 13:52
build elements blockchain
#!/bin/bash
sudo apt install git
cd
git clone https://github.com/ElementsProject/elements.git
sudo apt-get update
sudo apt-get install build-essential libtool autotools-dev autoconf pkg-config libssl-dev
sudo apt-get install libboost-all-dev
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler imagemagick librsvg2-bin
sudo apt-get install libqrencode-dev autoconf openssl libssl-dev libevent-dev

gnuplot

plot multiple files

plot for [i=0:5] 'degree_distribution_step:'.i.'_delta:5' title 'Degree step '.i ps 2

ps=point size

plot file to gif/png/svg script

@ethicnology
ethicnology / bitcoin-full-node.sh
Last active July 9, 2022 07:23
wget, chmod +x and execute
#!/bin/bash
echo Setup bitcoin full node.
echo Specify bitcoin version, e.g. 22.0:
read version
echo Install bitcoin-core version $version
#Download bitcoin-core:
wget https://bitcoincore.org/bin/bitcoin-core-$version/bitcoin-$version-x86_64-linux-gnu.tar.gz
#Download the list of cryptographic checksums:
wget https://bitcoincore.org/bin/bitcoin-core-$version/SHA256SUMS
#Download the signatures attesting to validity of the checksums:
@ethicnology
ethicnology / bloatware-remover-redmi-note-9-s.sh
Created August 30, 2020 14:07
bloatware remover for xiaomi redmi note 9 s
# inspired by https://selivan.github.io/2020/02/25/removing-bloatware-from-xiaomi-miui-android.html
pm uninstall --user 0 com.xiaomi.mipicks #GetApps - app store like Google Play from Xiaomi. The most annoying one, periodically shows advertisement.
pm uninstall --user 0 com.miui.msa.global #MIUI Ad Services - also responsible for showing ads.
pm uninstall --user 0 com.miui.cloudservice #Cloud
pm uninstall --user 0 com.miui.cloudbackup #Cloud Backup
pm uninstall --user 0 com.xiaomi.glgm #Games
pm uninstall --user 0 com.xiaomi.payment #Mi Credit
pm uninstall --user 0 cn.wps.xiaomi.abroad.lite #Mi DocViewer(Powered by WPS Office)
pm uninstall --user 0 com.xiaomi.midrop #Mi ShareMe
pm uninstall --user 0 com.miui.yellowpage #Mi YellowPages
@ethicnology
ethicnology / blackHijack.sol
Last active March 17, 2019 22:55
Hijackable smartContract : Let your classmates find the trick
/*
* __________________________________________________________________________________________________________________
* | | |
* | ________ ___ ________ ________ ___ __ ___ ___ ___ ___ ________ ________ ___ __ |
* | |\ __ \|\ \ |\ __ \|\ ____\|\ \|\ \ |\ \|\ \|\ \ |\ \|\ __ \|\ ____\|\ \|\ \ |
* | \ \ \|\ /\ \ \ \ \ \|\ \ \ \___|\ \ \/ /|\ \ \\\ \ \ \ \ \ \ \ \|\ \ \ \___|\ \ \/ /|_ |
* | \ \ __ \ \ \ \ \ __ \ \ \ \ \ ___ \ \ __ \ \ \ __ \ \ \ \ __ \ \ \ \ \ ___ \ |
* | \ \ \|\ \ \ \____\ \ \ \ \ \ \____\ \ \\ \ \ \ \ \ \ \ \|\ \\_\ \ \ \ \ \ \ \____\ \ \\ \ \ |
* | \ \_______\ \_______\ \__\ \__\ \_______\ \__\\ \__\ \__\ \__\ \__\ \________\ \__\ \__\ \_______\ \__\\ \__\ |
* | \|_______|\|_______|\|__|\|__|\|_______|\|__| \|__|\|__|\|__|\|__|