Skip to content

Instantly share code, notes, and snippets.

View Nanodragon999's full-sized avatar
🏠
Searching for a remote work.

Norton Nanodragon999

🏠
Searching for a remote work.
  • France
View GitHub Profile
@jkubecki
jkubecki / ExportKindle.js
Last active February 17, 2025 10:40
Amazon Kindle Export
// The following data should be run in the console while viewing the page https://read.amazon.com/
// It will export a CSV file called "download" which can (and should) be renamed with a .csv extension
var db = openDatabase('K4W', '3', 'thedatabase', 1024 * 1024);
getAmazonCsv = function() {
// Set header for CSV export line - change this if you change the fields used
var csvData = "ASIN,Title,Authors,PurchaseDate\n";
db.transaction(function(tx) {

LXC-with-VXLAN-tunneling

Seting up

  • Creating 2 KVM virtual machines (host1 and host2, each one them has kernel: 3.19.0-64-generic) and attached them in the network 192.168.10.0/24

  • Install LXC on each virtual machine

  • Interface of host1: 192.168.10.156

  • Interface of host2: 192.168.10.222

@girst
girst / load-balance.sh
Last active December 28, 2024 18:48
Simple Linux Load Balancing with `iproute2`
#!/bin/bash
# Load balance multiple internet connections. Requires iproute2, awk and grep.
# (C) 2016 Tobias Girstmair, isticktoit.net, GPLv2
# Also useful: speedometer -l -r eth1 -t eth1 -m $(( 1024 * 1024 * 3 / 2 ))
# Not much user error checking is done - only pass working network connections
# script needs root to work and at least two interfaces to be useful
[ $EUID -eq 0 -a $# -ge 2 ] || {
echo "Usage (as root): $0 iface1[:weight1] iface2[:weight2] ..." >&2
@bshishov
bshishov / wget-wiki.sh
Last active June 4, 2024 12:02
WGET recursive download of a mediawiki website with authorization
#!/bin/bash
WIKI_URL=___ # with trailing slash
WIKI_USERNAME=___
WIKI_PASSWORD=___
WIKI_DUMP_DIR=./dump
WIKI_DUMP_DIR_LOGIN=${WIKI_DUMP_DIR}/login
WIKI_LOGIN_PAGE="index.php?title=БлуТСбная:Π’Ρ…ΠΎΠ΄"
#WIKI_START_PAGE="index.php?title=Π‘ΠΎΠ΄Π΅Ρ€ΠΆΠ°Π½ΠΈΠ΅"
WIKI_START_PAGE="index.php/Π‘ΠΎΠ΄Π΅Ρ€ΠΆΠ°Π½ΠΈΠ΅"
@Ernillew
Ernillew / vpnns_up.sh
Created September 17, 2016 20:21
Start OpenVPN inside network namespace
#!/bin/bash
sudo ip netns add vpn
sudo ip netns exec vpn ip addr add 127.0.0.1/8 dev lo
sudo ip netns exec vpn ip link set lo up
sudo ip link add vpn0 type veth peer name vpn1
sudo ip link set vpn0 up
sudo ip link set vpn1 netns vpn up
sudo ip addr add 10.10.10.1/24 dev vpn0
sudo ip netns exec vpn ip addr add 10.10.10.2/24 dev vpn1
sudo ip netns exec vpn ip route add 37.59.63.23 via 10.10.10.1 dev vpn1
@maxivak
maxivak / readme.md
Last active November 21, 2022 21:16
Multiple networks in LXC container

Network for LXC container

Host device as bridge

  • persisted in host's /etc/network/interfaces the container's veth virtual ethernet interface can share the network link on the physical interface of the host (eth0). So the container resides on the same ethernet segment and talks to the same dhcp server as the host does.

Additonal bridge device

  • setup manually with brctl
@girst
girst / README.md
Last active April 5, 2019 19:46
`jj` - i3 tool for various tasks

i3tool by github.com/girst

Blog: iStickToIt.net

This is a simple program that lets you start programs / perform common tasks with very little key strokes.

Released under the GNU GPLv2. You can download a copy of the license from GNU.org

Setup

@kerma
kerma / example.py
Created August 3, 2016 09:01
Tornado access log split to STDOUT
import sys
import logging
import tornado.httpserver
import tornado.log
import tornado.options
import tornado.web
logger = logging.getLogger(__name__)
tornado.options.define("access_to_stdout", default=False, help="Log tornado.access to stdout")
@t0rr3sp3dr0
t0rr3sp3dr0 / CInstala.sh
Last active November 15, 2023 22:05
bash <(wget -qO- cin.ufpe.br/~phts)
#!/bin/bash
# UTILITIES BEGIN
function L {
cat << EOF
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—
β–ˆβ–ˆβ•”β•β•β•β•β• β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β•β•β• β•šβ•β•β–ˆβ–ˆβ•”β•β•β• β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—
β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘
@RickCogley
RickCogley / curl-to-matrix-text-readme.md
Last active February 25, 2024 01:45
Testing curl to matrix.org

Testing the matrix.org client-server API

Matrix is:

an open standard for decentralised communication, providing simple HTTP APIs and open source reference implementations for securely distributing and persisting JSON over an open federation of servers.

It's pretty fantastic, if you think on the massive problem of fragmentation all across the web. They've created an easy to use API, and you can do a kludgy test using curl from the terminal (*nix, mac, win). See: http://matrix.org/docs/howtos/client-server.html

It's pretty straightforward to do a quick test. I have an account at https://matrix.org / https://vector.im, so I used that to get a token.