Skip to content

Instantly share code, notes, and snippets.

View clickfreak's full-sized avatar

Konstantin Novakovskii clickfreak

View GitHub Profile
@clickfreak
clickfreak / vscale_upload_zone.py
Last active February 9, 2016 15:24
Import dns zone into vscale domains
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import json
import logging
import httplib
import argparse
@clickfreak
clickfreak / pypresender.py
Last active August 18, 2016 04:18
Resend udp packet to another host using pcap
#!/usr/bin/env python
import pcap
import socket
from scapy.all import *
conf.use_pcap=True # because by default scapy try to use raw socket and can't assign bpf filter
conf.verb=0 # it just grab all traffic and get error on processing
import scapy.arch.pcapdnet
@clickfreak
clickfreak / gist:6363333b5713274ccc6f7a1d6e57c6cb
Last active December 17, 2016 20:39
Get public ssh keys from github
#!/bin/sh
curl -s https://api.github.com/users/<username>/keys | jq -r ".[].key" > ~/.ssh/authorized_keys_github
@clickfreak
clickfreak / Netfilter-IPTables-Diagrams.md
Created May 3, 2018 20:55 — forked from nerdalert/Netfilter-IPTables-Diagrams.md
Linux NetFilter, IP Tables and Conntrack Diagrams

Linux NetFilter, IP Tables and Conntrack Diagrams

IPTABLES TABLES and CHAINS

IPTables has the following 4 built-in tables.

1) Filter Table

Filter is default table for iptables. So, if you don’t define you own table, you’ll be using filter table. Iptables’s filter table has the following built-in chains.

@clickfreak
clickfreak / fedora_jackd_mixxx.md
Created September 30, 2018 22:27
Mixxx over jackd on Fedora
sudo dnf install jack-audio-connection-kit-dbus qjackctl rtirq realTimeConfigQuickScan
sudo usermod -a -G audio,jackuser,users `whoami`
$ cat /etc/security/limits.d/95-jack.conf:

@jackuser - rtprio 90
@jackuser - nice -19
@jackuser - memlock 209715200
@clickfreak
clickfreak / mount_qcow2.md
Created April 6, 2019 21:08 — forked from shamil/mount_qcow2.md
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
sudo dnf install mixxx jack-audio-connection-kit-dbus qjackctl rtirq realTimeConfigQuickScan kernel-tools
sudo usermod -a -G audio,jackuser,users `whoami`

https://wiki.linuxaudio.org/wiki/system_configuration

$ cat /etc/security/limits.d/95-jack.conf:

@jackuser - rtprio 90
@clickfreak
clickfreak / upload_dns_help.txt
Last active October 4, 2019 09:56
Import bind-zone file to Selectel DNS via API
usage: bind_upload.py [-h] --key <key> --name <name> --zone <zone>
Selectel domains-api bind-zone import helper
optional arguments:
-h, --help show this help message and exit
required named arguments:
--key <key> Your API Key
--name <name> Domain name for creation
@clickfreak
clickfreak / kernel_upgrade.yml
Created January 12, 2015 17:14
HWE kernel on ubuntu precise (Ansible playbook)
---
- name: install HWE Stack on Ubuntu 12.04
hosts: all
user: someuser
sudo: yes
tasks:
- name: Install linux-hwe-generic package
apt:
@clickfreak
clickfreak / gcore_cloud_find_instances.py
Created April 15, 2022 21:14
How to find regions with instances in G-Core Labs cloud
#!/usr/bin/env python3
import os
import json
import requests
import logging
# you can create permanent token in account settings: https://accounts.gcorelabs.com/profile/api-tokens
APIKEY = '<your_permanent_token>'