Skip to content

Instantly share code, notes, and snippets.

View sxiii's full-sized avatar
🐧
Ask me any questions on free and open source software!

Dennis Ivanov sxiii

🐧
Ask me any questions on free and open source software!
View GitHub Profile
@sxiii
sxiii / debug.log
Created February 5, 2020 10:09
debug.log for wappalyzer-puppeteer
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'i', '-g', 'wappalyzer-puppeteer' ]
2 info using npm@6.13.6
3 info using node@v13.7.0
4 verbose npm-session 0c2d8b0706737a16
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 304 https://registry.npmjs.org/wappalyzer-puppeteer 210ms (from cache)
8 silly pacote tag manifest for wappalyzer-puppeteer@latest fetched in 219ms
9 timing stage:loadCurrentTree Completed in 243ms
@sxiii
sxiii / docker-manjaro-oneliner-install.sh
Last active October 5, 2023 08:08
Install Docker latest version on Manjaro or Arch linux (fresh install) and enable autorun for it (via systemd)
#!/bin/bash
# This script installs latest version of Docker into Manjaro or Archlinux PLUS enables autorun for it (via systemd)
# The best thing, is you can run this command right after OS installation
# It will install everything you need automatically
# What does actually it install?
# * pyalpm package (dependency for pikaur)
# * Pikaur (AUR client)
# * Docker (from AUR)
# You can run this as oneliner OR download this file, make it executable (`chmod +x`) and run like `/docker-manjaro-oneliner-install.sh`
mkdir pikaur && cd pikaur && wget https://raw.githubusercontent.com/actionless/pikaur/master/PKGBUILD && sudo pacman -y --noconfirm -S pyalpm && makepkg && sudo pacman --noconfirm -U pikaur*tar.xz && pikaur -y -S docker && systemctl start docker && systemctl enable docker
@sxiii
sxiii / docker-network-remove-help.txt
Created May 6, 2020 03:30
While removing networks, if your docker stuck in not existing tasks
Is your docker daemon stuck in this error while trying to remove network?
* Error response from daemon: rpc error: code = 9 desc = network {ID_OF_NETWORK} is in use by task {ID_OF_TASK}?
Don't worry; I have a solution for you.
When I found it was this:
* sudo docker run -v /var/run/docker/swarm/control.sock:/var/run/swarmd.sock dperny/tasknuke {ID_OF_TASK}
and then
* sudo docker network rm {NAME_OR_ID_OF_NETWORK}
@sxiii
sxiii / minecraft-backup.sh
Created June 3, 2020 20:03
Minecraft backup to free file hosting OSHI.at
#!/bin/bash
# Requirements: linux, bash, 7zip, minecraft
# Server folder: newhorizons
# Does not backup server config
# Step 1. Archive server folder
7z a mine.zip ./newhorizons
# Step 2. Send to Oshi.at and information to backup.log
curl -T mine.zip https://oshi.at >> backup.log
# Step 3. Add date to backup.log
@sxiii
sxiii / ramcheck.sh
Created June 9, 2020 17:02
Print a linux GUI notification if system is running out of RAM
#!/bin/bash
# RAM CHECK by Security XIII #
# This script checks your available RAM and sends a notification if you're getting over the limit
# Limit is set as "min" varialbe below (defaults to 1.0 GiB)
# Requirements: linux, bash, grep, awk (usually available everywhere so no need to install anything)
# The script is non-interactive (running only once). If you want to make it interactive, just save it as ramcheck.sh and do:
# ``` while true; do ./ramcheck.sh; sleep 1; done ```
# The above example runs the check 1 time every second. Feel free to make the script interactive if you want to.
ram=$(free -h | grep Mem | awk -F" " '{ print $7 }' | awk -F"Gi" '{ print $1 }')
@sxiii
sxiii / resize-sdcard-partitions.md
Last active December 5, 2022 10:48
Resize linux partition that was written by DD or similar instrument to use all available space

Please run the following commands to resize a partition.
IMPORTANT NOTE: Don't forget to change partition address from /dev/sdb2 to your actual partition!
CHANGES ARE DONE IN TWO OR THREE PLACES.
Example below are for /dev/sdb2 partition which is called like "/dev/sdb 2" for growpart
and like "/dev/sdb2" for resize2fs & e2fsck.
Requirements: * growpart; * resize2fs; * e2fsck if disk requires checking.
Install growpart in arch/manjaro: pikaur -S growpart (resize2fs and e2fsck are usually bundled with OS)

sudo growpart /dev/sdb 2
@sxiii
sxiii / btc_rate_exchanges.sh
Created June 19, 2020 04:40
Show rate of BTC on different exchanges
######### CRYPTOCOMPARE UBER API! ############
### API: https://min-api.cryptocompare.com ###
##############################################
# 67 exchanges ###############################
##############################################
base=BTC
target=USD
markets=(Bit2C BitBay Bitfinex bitFlyer bitFlyerFX Bithumb BitMarket Bitmex Bitso BitSquare Bitstamp BitTrex Bleutrade BTC38 BTCC BTCChina BTCE BTCMarkets BTCXIndia BTER CCEDK CCEX Cexio CHBTC OKEX Coinbase CoinCheck Coinfloor Coinone Coinse Coinsetter Cryptonator Cryptopia CryptoX Cryptsy Exmo Gatecoin Gemini HitBTC Huobi itBit Jubi Korbit Kraken LakeBTC Liqui LiveCoin LocalBitcoins Luno MercadoBitcoin MonetaGo Novaexchange OKCoin Paymium Poloniex QuadrigaCX Quoine TheRockTrading Tidex TuxExchange Unocoin Vaultoro ViaBTC WavesDEX Yacuna Yobit Yunbi Zaif btcXchange CCCAGG ANXBTC EtherDelta EthexIndia Binance Lykke Remitano Coinroom Abucoins BXinth Gateio HuobiPro MtGox)
@sxiii
sxiii / getip.sh
Created June 22, 2020 22:20
Get your IP-based location (city, country), hostname and other stuff
#!/bin/bash
# This oneliner shows your current IP based location (city, country) as well as hostname
# * requirements: httpie (http), jq (jquery for cli), linux, bash
# You can also add other fields
http ifconfig.co/json | jq '.city + ", " + .country + ", " + .hostname'
# Other fields
# {
# "asn": "AS12876",
@sxiii
sxiii / Install-RancherOS-help.md
Created July 6, 2020 23:36
Install RancherOS to bare metal - oneliner instructions

Step 1. Download recent RancherOS.iso file from the github repo

Step 2. Burn RancherOS.iso with dd, dcfldd or BalenaEtcher

Step 3. Change the BIOS setting for your device to boot from USB flash and insert it, then reboot

Step 4. Run installation (replace the /dev/sda with your memory device and password with anything you like)

sudo ros install -f -d /dev/sda --append "rancher.password=original"

Result: RancherOS is installed & the system user "rancher" will have password "original" in the case above.

@sxiii
sxiii / flag-stripe-generator.sh
Last active July 7, 2020 20:36
Flag Vertical Stripe Generator
#!/bin/bash
# This script generates a vertical strip of flags, about 200 px wide
# Replace countrues variable with the ISO country names you want
# It automatically downloads flags from github repo
#count=(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31)
countries=(ad at be by ba va gb de hk dk it es cn li mx nl no pl ru si us tr ua fr fi me cz se ch ee jp)
#countries=(andorra austria belgium bosnia-and-herzegovina vatican-city united-kingdom germany hong-kong denmark italy spain china liechtenstein mexico netherlands norway poland russia slovenia united-states-of-america turkey ukraine france finland montenegro czech-republic sweden switzerland estonia japan)
flagformat=".svg"
program=convert