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 / VRAMFS_Linux_HowTo.md
Last active November 11, 2020 08:37
Installing a vRAM disk (vramfs) in Arch Linux (Manjaro) on the GPU

This is guide on how to create VRAM (Video-RAM disk to use your videocard memory as additional disk).
This can be used for testing, benchmarks, etc.
The manual is for Nvidia card. However, it will be +- similar for ATI/AMD and Intel cards, the only thing you need to change is the "opencl" packages (for ATI/AMD it would probably be opencl-mesa package while for intel - intel-compute-runtime).

Doing this on Arch (Manjaro) system recent (Mikah).
Additional requirements:

  • pikaur (or use your own faviourite AUR helper instead!)
  • several hundreds megabytes free on hdd/ssd/whatever
  • several GBs of memory on your GPU to utilize the VRAM disk (ideally, 4, 8 or more GBs)
@sxiii
sxiii / WormsWMD-Archlinux.md
Last active April 14, 2024 14:21
How to fix Worms W.M.D. launch on ArchLinux, Manjaro, Garuda, Artix Linux & Linux Mint

Game information Worms W.M.D.

Distribution name and version where applicable Manjaro 20.1.1 (Mikah)

Problem description Worms doesn't launch out of the box without two small tweaks. When launching Worms W.M.D. in Manjaro and Archlinux, you need to do two things:

  1. Install this apps: sudo pacman -S libcurl-gnutls libidn11 qt5-base qt5-xcb-private-headers(If you are on any other distro then Arch, you can skip this step. At least this is reported to be OK to skip for Linux Mint)
@sxiii
sxiii / remove.sh
Created October 5, 2020 05:35
Docker Swarm - Remove all Down nodes automatically
#!/bin/bash
# Requirements: linux, docker, grep, awk
# This script removes all "Down" (off) nodes from Docker Swarm
# Useful to clean stuff from time to time, if you have auto-joining nodes for example
sudo docker node rm $(sudo docker node ls | grep Down | awk -F" " '{ print $1 }')
@sxiii
sxiii / configure-alienware-nvidia.md
Last active September 27, 2020 17:10
How to configure Alienware Laptop with External Graphics Amplifier and Nvidia Card on Manjaro Linux (also might work in Arch)

My Laptop is Alienware R3 17" with external amplifier card "Nvidia RTX 2070" but it should work for other Nvidia's, as well.

The process is pretty easy.

  1. Turn off laptop. Connect the external amplifier with GPU and electricity, as well as connect laptop to electricity. Turn everything back ON & boot into Manjaro or Arch.

  2. Ensure the system is fully updated:

sudo pacman -Syyu or just update the system by using GUI "Software Update" from system menu.

@sxiii
sxiii / run_remote_cmd_as_root_via_ssh.sh
Last active July 17, 2020 18:56
Root remote command execution without actual root access
# Let's say you want to connect to remote host (via SSH) as normal user and then execute command there as root.
# This way, you can execute root commands on the server, even without remote root access.
# You also want your command to continue as well as disconnect from the remote host.
# In the example below, we will run a docker container which requires the NET_ADMIN (root access) as example command ($cmd)
# This can be achieved by using such tools as "screen" and "sshpass", so requirements are installing them:
# `sudo pacman -S screen sshpass` # Command for Arch/Manjaro
# `sudo apt install screen sshpass` # Command for Debian/Ubuntu
# `sudo dnf install screen sshpass` # Command for Fedora/CentOS
# After you have this requirements, you need to specify your variables:
@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
@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 / 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 / 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 / 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