Skip to content

Instantly share code, notes, and snippets.

View nqxcode's full-sized avatar
:octocat:
Working...

Andrey Pokoev nqxcode

:octocat:
Working...
  • Tula
View GitHub Profile
@nqxcode
nqxcode / migration-of-linux-system-to-another-disk.md
Created December 22, 2020 22:29
Migration of linux system to another disk

Migration of linux system to another disk.

Case for disk with MBR.

1. Copy source disk partitions / and /home to another disk.

# mkdir /mnt/sdb1
# mount /dev/sdb1 /mnt/sdb1
# cd /
@nqxcode
nqxcode / socks-tunnel
Last active September 12, 2022 18:52
Socks tunnel service for OpenWrt 19.07.2
/root/bin/socks_tunnel
#!/bin/bash
trap "stop" SIGTERM SIGINT
if [[ -z $1 ]]; then
echo 'Please, specify server...'
exit 1
fi
@checco
checco / postgres-owner-grants.sql
Last active September 11, 2024 08:55
How to change OWNER for DATABASE, SCHEMA or TABLE on AWS RDS PostgreSQL. An how to REASSIGN owner for all objects on AWS RDS PostgreSQL
--
-- Change database owner
--
ALTER DATABASE "db_name" OWNER TO user;
--
-- List schemas
--
@ralic
ralic / vino-server.sh
Created July 27, 2018 11:03 — forked from torson/vino-server.sh
vino-server start/stop/status script , run it under the logged-in user
#!/bin/bash
### BEGIN INIT INFO
# Provides: vino-server
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Should-Start:
# Should-Stop:
# X-Start-Before:
# X-Stop-After:
@numb95
numb95 / route-all-traffic-through-tor.md
Last active August 19, 2024 21:17
Route all internet traffic through Tor

Do not use in production Server or if you don't know what iptables do

Add this to torrc ( located on /etc/tor/torrc):

VirtualAddrNetwork 10.192.0.0/10

AutomapHostsOnResolve 1

TransPort 9051 
@DusanMadar
DusanMadar / TorNoAuth.md
Last active April 17, 2024 18:59
A step-by-step guide how to use Tor without Authentication
@crittermike
crittermike / wget.sh
Last active August 29, 2024 10:47
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
@Kaundur
Kaundur / canvasDownload.js
Created June 8, 2017 07:25
JS to automatically download canvas as a png
// This code will automatically save the current canvas as a .png file.
// Its useful as it can be placed in a loop to grab multiple canvas frames, I use it to create thumbnail gifs for my blog
// Only seems to work with Chrome
// Get the canvas
var canvas = document.getElementById("canvas");
// Convert the canvas to data
var image = canvas.toDataURL();
// Create a link
var aDownloadLink = document.createElement('a');
@ssalonen
ssalonen / OpenWrt SSH tunnel.md
Last active February 13, 2024 21:29
OpenWrt SSH tunnel

Short how-to for creating a reverse ssh tunnel to a remote server. Useful for breaking NATted connection for example.

  1. At OpenWrt:
opkg update
opkg install sshtunnel
  1. At remote server: create client ssh keys
@alexeygrigorev
alexeygrigorev / vimeo-download.py
Created September 17, 2016 09:09
Downloading segmented video from vimeo
import requests
import base64
from tqdm import tqdm
master_json_url = 'https://178skyfiregce-a.akamaihd.net/exp=1474107106~acl=%2F142089577%2F%2A~hmac=0d9becc441fc5385462d53bf59cf019c0184690862f49b414e9a2f1c5bafbe0d/142089577/video/426274424,426274425,426274423,426274422/master.json?base64_init=1'
base_url = master_json_url[:master_json_url.rfind('/', 0, -26) + 1]
resp = requests.get(master_json_url)
content = resp.json()