This file contains hidden or 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 string | |
import random | |
import sys | |
if len(sys.argv) != 2: | |
print("\033[91mUsage:\033[0m", sys.argv[0], "pass_length") | |
sys.exit(1) | |
pass_len=int(sys.argv[1]) |
This file contains hidden or 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
package main | |
import "net/http" | |
func main() { | |
// http.Handle is relative to directory where http.go is run from | |
// http.Dir is relative path from where http.go was executed from | |
http.Handle("/", http.FileServer(http.Dir("./html"))) | |
http.ListenAndServe(":8080", nil) | |
} |
This file contains hidden or 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
/* Compile with | |
* ]$ gcc getdents.c -o getdents | |
*/ | |
#define _GNU_SOURCE | |
#include <dirent.h> | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
#include <sys/stat.h> |
This file contains hidden or 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
# brand new install with iso | |
virt-install -n gues_name --os-type=Linux --ram=2048 --vcpus=2 --disk path=/path/to/disk/new_guest_disk.img,size=20 --cdrom=/path/tp/ISOs/new_iso.iso --network bridge:br0 --graphics vnc,listen=0.0.0.0 --noautoconsole | |
# delete kvm | |
virsh list --all | |
virsh undefine guest_name | |
virsh vol-list --pool Disks # Disks is where I have my disks stored, /path/to/Disks | |
virsh vol-delete --pool Disks guest_disk.img | |
# import from existing image |
This file contains hidden or 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
[root@kern ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org | |
[root@kern ~]# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm | |
[root@kern ~]# yum --enablerepo=elrepo-kernel install kernel-ml | |
[root@kern ~]# cd /boot | |
[root@kern boot]# ls -l | |
----MAKE NOTE of initramfs-[kern_version].img and vmlinuz-[kern_version] you want to boot from, version must match---- | |
[root@kern ~]# kexec -l /boot/vmlinuz-4.0.4-1.el7.elrepo.x86_64 --initrd=/boot/initramfs-4.0.4-1.el7.elrepo.x86_64.img --command-line="root=/dev/vda1 ro" | |
[root@kern ~]# reboot |
This file contains hidden or 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 sys, os, socket, ssl | |
from socketserver import ThreadingMixIn | |
from http.server import SimpleHTTPRequestHandler, HTTPServer | |
HOST = socket.gethostname() | |
class ThreadingSimpleServer(ThreadingMixIn, HTTPServer): | |
pass |
This file contains hidden or 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 sys, os, socket | |
from socketserver import ThreadingMixIn | |
from http.server import SimpleHTTPRequestHandler, HTTPServer | |
HOST = socket.gethostname() | |
class ThreadingSimpleServer(ThreadingMixIn, HTTPServer): | |
pass |
This file contains hidden or 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 http.server, socketserver, socket, ssl | |
PORT = 443 | |
HOST = socket.gethostname() | |
Handler = http.server.SimpleHTTPRequestHandler | |
https = socketserver.TCPServer(("0.0.0.0", PORT), Handler) | |
https.socket = ssl.wrap_socket(https.socket, keyfile='/path/to/keyfile.key', certfile='/path/to/certfile.crt', server_side=True, ssl_version=ssl.PROTOCOL_TLSv1_2, ca_certs=None, do_handshake_on_connect=True, suppress_ragged_eofs=True, ciphers='ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK') |
This file contains hidden or 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 python2 | |
import time | |
def pig_latin(): | |
original = raw_input("Give me a word: ") | |
if len(original) > 0 and original.isalpha(): | |
# print "You originally inputed:", original | |
low_orig = original.lower() | |
pig = "ay" | |
fl = low_orig[0] |
This file contains hidden or 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 python2 | |
import time | |
def joel_or_ellie(): | |
char = raw_input("(J)oel or (E)llie? ").lower() | |
if char == "joel" or char == "j": | |
joel_weapons() | |
elif char == "ellie" or char == "e": | |
ellie_weapons() | |
else: |