Skip to content

Instantly share code, notes, and snippets.

View add1ct3d's full-sized avatar
🎯
Focusing

add1ct3d

🎯
Focusing
View GitHub Profile
@add1ct3d
add1ct3d / setup-headless-selenium-xvfb.sh
Created March 9, 2019 04:40 — forked from amberj/setup-headless-selenium-xvfb.sh
Bash script to install/setup headless Selenium (uses Xvfb and Chrome)
#!/bin/bash
#
# Bash script to setup headless Selenium (uses Xvfb and Chrome)
# (Tested on Ubuntu 12.04)
# Add Google Chrome's repo to sources.list
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list
# Install Google's public key used for signing packages (e.g. Chrome)
# (Source: http://www.google.com/linuxrepositories/)
@add1ct3d
add1ct3d / initial-vps-setup.sh
Created March 9, 2019 04:41 — forked from amberj/initial-vps-setup.sh
Initial setup of hosted VPS (which comes with 'root' access by default)
#!/bin/bash
# ABOUT:
#
# Use this set of commands to:
# - Change password of root account
# - Create a new user account, set it's password and grant sudo privileges
# on Ubuntu Linux.
# Change password of currently logged in 'root' account:
@add1ct3d
add1ct3d / fizzbuzz.py
Created March 9, 2019 04:42 — forked from amberj/fizzbuzz.py
FizzBuzz
# fizzbuzz.py
# Python implementation of FizzBuzz (http://imranontech.com/2007/01/24/using-fizzbuzz-to-find-developers-who-grok-coding/)
#
# Author: Amber Jain (http://amberj.devio.us/)
# Problem description:
# Write a program that prints the numbers from 1 to 100.
# But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz".
# For numbers which are multiples of both three and five print "FizzBuzz".
# Problem source: http://imranontech.com/2007/01/24/using-fizzbuzz-to-find-developers-who-grok-coding/
@add1ct3d
add1ct3d / network-tweak.md
Created April 20, 2019 04:00 — forked from mustafaturan/network-tweak.md
Linux Network Tweak for 2 million web socket connections

Sample config for 2 million web socket connection

    sysctl -w fs.file-max=12000500
    sysctl -w fs.nr_open=20000500
    # Set the maximum number of open file descriptors
    ulimit -n 20000000

    # Set the memory size for TCP with minimum, default and maximum thresholds 
 sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
#!/usr/bin/python
# DNSpionage log parser
# This script displays the exfiltrated data in the log.txt file
# It only supports the DNS mode. The HTTP mode does not encode the exfiltrated data in the log file
# Can be easily adapted to parse passive DNS logs
# @r00tbsd
import sys
import base64
@add1ct3d
add1ct3d / ca.md
Created May 24, 2019 04:06 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@add1ct3d
add1ct3d / pycrypto_DES3.py
Created August 5, 2019 17:15 — forked from komuw/pycrypto_DES3.py
python DES3(triple DES encryption)
`pip install pycrypto`
from Crypto.Cipher import DES3
from Crypto import Random
key = 'Sixteen byte key'
iv = Random.new().read(DES3.block_size) #DES3.block_size==8
cipher_encrypt = DES3.new(key, DES3.MODE_OFB, iv)
plaintext = 'sona si latine loqueri ' #padded with spaces so than len(plaintext) is multiple of 8
encrypted_text = cipher_encrypt.encrypt(plaintext)
@add1ct3d
add1ct3d / sysctl.conf
Created August 24, 2019 01:08 — forked from voluntas/sysctl.conf
Sysctl configuration for high performance
### KERNEL TUNING ###
# Increase size of file handles and inode cache
fs.file-max = 2097152
# Do less swapping
vm.swappiness = 10
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
@add1ct3d
add1ct3d / stratum-proxy.py
Created October 12, 2019 20:50 — forked from CryptoManiac/stratum-proxy.py
Generic NoDevfee proxy for ethereum
#!/usr/bin/python2.7
import sys
import socket
import threading
import json
from collections import OrderedDict
import binascii
import datetime
import time
@add1ct3d
add1ct3d / whattomine-hashtimes.py
Created December 2, 2019 23:46 — forked from bmatthewshea/whattomine-hashtimes.py
Python script to calculate time to win full block and revenue per day. (GPU MINING)
#!/usr/bin/python
# -*- coding: utf-8 -*-
# "Whattomine GPU Hash time calculator"
#
# This is not for CPU or ASIC calculations.
# Author: Brady Shea
# Email: Use github user: bmatthewshea or gist comments
# Origin: https://gist.github.com/bmatthewshea/90b120722e0561dd235adcdc231b6765
#