- Create a folder at the root of your user home folder
(Example:
C:/Users/username/
) called.ssh
.
You can run something like:mkdir -p ~/.ssh
- Create the following files if they do not already exist (paths begin from the root of your user home folder):
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def singleton(cls): | |
_instance = {} | |
def inner(): | |
if cls not in _instance: | |
_instance[cls] = cls() | |
return _instance[cls] | |
return inner() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import sys | |
import dns.resolver | |
def check_dns(domain_name: str, dns_server: str): | |
# Create a DNS resolver instance and set the nameserver to the DNS server you want to query | |
resolver = dns.resolver.Resolver(configure=False) | |
resolver.nameservers = [dns_server] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import subprocess | |
import requests | |
def get_domain_locations(domain_name: str) -> dict: | |
# Use dig command to retrieve IP addresses of domain | |
result = subprocess.run(['dig', '+short', domain_name], stdout=subprocess.PIPE) | |
ip_addresses = result.stdout.decode('utf-8').strip().split('\n') | |
ip_addresses = [i for i in ip_addresses if i.count('.') == 3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <string.h> | |
#include <assert.h> | |
struct MatchOffset { | |
int start; | |
int end; | |
int GetMatchedCount() { | |
return end - start; | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Windows.h> | |
#include <deque> | |
#include <string> | |
void ListFilesBFS(const std::string& root_dir) | |
{ | |
std::deque<std::string> output; | |
WIN32_FIND_DATA findfiledata; | |
HANDLE hFind = INVALID_HANDLE_VALUE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import path | |
from os import mkdir | |
from os import getenv | |
from os import name as os_name | |
from time import time | |
total_files_count = 12345 | |
MAX_FILES_SINGLE_DIR = 500 | |
DEBUG_DIR_NAME = "TestCreateFiles" | |
DIR_PREFIX = "dir_" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# encoding: utf-8 | |
# Edit time: 2018-06-05 20:32 | |
# This scripts print some hack attack affect | |
# Just makes ordinary people think about we are hacking an account | |
import sys | |
from time import sleep | |
import random | |
import string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// copy from: https://stackoverflow.com/questions/13479833/java-swt-animated-gif | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import org.eclipse.swt.graphics.GC; | |
import org.eclipse.swt.graphics.Image; | |
import org.eclipse.swt.graphics.ImageData; | |
import org.eclipse.swt.graphics.ImageLoader; | |
import org.eclipse.swt.widgets.Canvas; |
NewerOlder