Skip to content

Instantly share code, notes, and snippets.

👺

Cameron SkamDart

👺
Block or report user

Report or block SkamDart

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@SkamDart
SkamDart / delete_crons.sh
Created Oct 19, 2018
one liner delete all cronjobs with name
View delete_crons.sh
kubectl get cronjob | grep 'jobprefix' | awk '{print $1}' | xargs kubectl delete cronjob
@SkamDart
SkamDart / k8_delete.sh
Created Sep 19, 2018
batch delete kubernetes jobs
View k8_delete.sh
kk get pods | grep 'job-name-' | awk '{print $1}' | xargs kubectl delete pods
View gist:412714e71e167df90b7b37bbe8ea6d35
# Copyright 2018 Cameron Dart
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
@SkamDart
SkamDart / gist:5dd14cc667b409df3d4523fb159bc866
Created Jun 11, 2018
my mac install script. this is completely untested
View gist:5dd14cc667b409df3d4523fb159bc866
# Copyright 2018 Cameron Dart
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
@SkamDart
SkamDart / find_deps.py
Created May 9, 2018
Determines which modules are used by a python script
View find_deps.py
from modulefinder import ModuleFinder
import sys
def print_dependencies(filename):
f = ModuleFinder()
f.run_script(filename)
names = list(f.modules.keys())
basemods = sorted(set([name.split(".")[0] for name in names]))
print("\n".join(basemods))
View perf.sh
#!/usr/bin/env bash
for i in $(seq 1 10); do (QtSpimbot -randommap -run -exit_when_done -maponly -quiet -f spimbot.s 2>/dev/null >> out.log &); done
@SkamDart
SkamDart / test_all.sh
Created Apr 25, 2018
test_all bash script Lab14
View test_all.sh
#!/usr/bin/env bash
# 2>/dev/null redirects all file descriptor 2 (stderr) output to /dev/null
# remove or replace /dev/null with a file if you care to see stderr
# first output is the scalar version per the provided Makefile
MAKE='make t'
for i in $(seq 1 6); do $MAKE$i 2>/dev/null | grep 't'$i' took'; done
make mandelbrot && ./mandelbrot
View add_line.cpp
void
add_line(unsigned int start_pos, unsigned int end_pos,
unsigned int* canvas, unsigned int* origin)
{
int step_size = 1;
if ((start_pos ^ end_pos) & 31)
{
step_size = 32;
}
if (start_pos > end_pos)
View ngrok.sh
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
unzip ngrok-stable-linux-amd64.zip
./ngrok http 6006
View twitterurl.py
## Import libraries and functions needed
## define URL
def get_url(All=None, Exact=None, Any=None, Not=None, Hashtag=None, From=None,
To=None, Mention=None, Near=None, Dates=None):
#Base URL
url = "https://twitter.com/search?l=&q="
# All
if All != None:
a = All.replace(" ", "%20")
You can’t perform that action at this time.