Skip to content

Instantly share code, notes, and snippets.

View DeviaVir's full-sized avatar
🏴‍☠️

Chase DeviaVir

🏴‍☠️
View GitHub Profile
import time
def main():
SLEEP_DELAY = 10
for i in xrange(100):
print("Hello world! The time is now: %s. Sleeping for %d secs" % (
time.asctime(), SLEEP_DELAY))
time.sleep(SLEEP_DELAY)
if __name__ == "__main__":
@DeviaVir
DeviaVir / coredumpctl.gdb
Created July 4, 2018 09:03
q-desktop core dump
$ coredumpctl gdb 7884
PID: 7884 (q-desktop)
UID: 1000 (chase)
GID: 985 (users)
Signal: 5 (TRAP)
Timestamp: Wed 2018-07-04 10:58:14 CEST (1min 39s ago)
Command Line: /usr/bin/q-desktop
Executable: /usr/bin/q-desktop
Control Group: /user.slice/user-1000.slice/session-c1.scope
Unit: session-c1.scope
#!/bin/bash
. "${0%/*}/../common.sh"
declare -A default
while IFS== read key value; do
default["$key"]="$value"
done < /etc/hardening-wrapper.conf
force_fPIE="${HARDENING_PIE:-"${default[HARDENING_PIE]:-1}"}"
abs
adobe-source-han-sans-cn-fonts
aic94xx-firmware
alsa-utils
anamnesis
android-tools
ansible
arch-install-scripts
archon
archon-exec
#!/usr/bin/perl -w
# recover rsyslog disk queue index (.qi) from queue files (.nnnnnnnn).
#
# See:
# runtime/queue.c: qqueuePersist()
# runtime/queue.c: qqueueTryLoadPersistedInfo()
#
# kaiwang.chen@gmail.com 2012-03-14
#
use strict;
@DeviaVir
DeviaVir / internal-network-healthcheck.py
Created April 6, 2018 10:14
Quick snippet for checking network health of google.com (external) and wiki.xxxxxx.com (internal) to try and pinpoint when and to what extend network issues are occurring.
import socket
import time
import datetime
def is_connected(remote_server):
try:
host = socket.gethostbyname(remote_server)
socket.create_connection((host, 80), 2)
return True
resource "gsuite_group" "test" {
email = "test${count.index}@sillevis.net"
name = "test${count.index}@sillevis.net"
description = "Test ${count.index}"
count = 1000
}
func scanIdentifier(s string) (string, int) {
byteLen := 0
runeLen := 0
for {
if byteLen >= len(s) {
break
}
nextRune, size := utf8.DecodeRuneInString(s[byteLen:])
if (!(nextRune == '_' ||
@DeviaVir
DeviaVir / read-from-remote.json
Last active January 25, 2018 13:44
terraform dots in var names?
{
"data": {
"terraform_remote_state": {
"networking-int": {
"backend": "gcs",
"config": {
"bucket": "networking-int",
"path": "terraform.tfstate",
"region": "us-east1",
"project": "networking-int"
@DeviaVir
DeviaVir / github-mover-automation.py
Created January 2, 2018 17:12
Automate moving github issues. Make sure to log in to github (authorize button) within 30 seconds after the first browser window opens. This will hit the rate limits and block you for an hour if you over use it.
#!/usr/bin/env python3
import requests
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
urls = []