Skip to content

Instantly share code, notes, and snippets.

View Kegn's full-sized avatar

kegan Kegn

View GitHub Profile
@Kegn
Kegn / kvm-support.info
Created May 31, 2017 07:28
check your hardware for kvm compatibility
[k@arx ~]$ #check cpu for virtualization support, virtual router, support vector machine
[k@arx ~]$ egrep --color=auto 'vmx|svm|0xc0f' /proc/cpuinfo
<long output...>
[k@arx ~]$ #check that kernel kvm modules are available (m or y)
[k@arx ~]$ zgrep CONFIG_KVM /proc/config.gz
CONFIG_KVM_GUEST=y
# CONFIG_KVM_DEBUG_FS is not set
CONFIG_KVM_MMIO=y
CONFIG_KVM_ASYNC_PF=y
@Kegn
Kegn / .bashrc
Last active July 21, 2017 07:33
.bashrc
if [ -f /etc/bashrc ]; then
source /etc/bashrc
fi
export GITHOME="/home/k/development/github/"
export EDITOR=vim
export HISTCONTROL=ignoredups
export PS1="\[$(tput bold)\]\[$(tput setaf 2)\][\[$(tput setaf 7)\]\u\[$(tput setaf 6)\]@\[$(tput setaf 5)\]\h \[$(tput setaf 6)\]\W\[$(tput setaf 2)\]]\[$(tput setaf 6)\]\\$ \[$(tput setaf 7)\]"
# colored man pages
@Kegn
Kegn / ginit.sh
Created July 21, 2017 07:35
aimed at improving my github workflow
#!/bin/bash
if [ -f /etc/gitprompt ]; then
source /etc/gitprompt
fi
PS1="\[$(tput bold)\]\[$(tput setaf 1)│\[$(tput setaf 5)\]\u\[$(tput setaf 6)\]@\[$(tput setaf 7)\]\h \[$(tput setaf 1)\]git\[$(tput setaf 7)\] : \[$(tput setaf 2)\]\W\[$(tput setaf 1)\]│\[$(tput setaf 6)\]→\[$(tput setaf 5)\] "
shxcolors () {
for color in {0..16}; do {
@Kegn
Kegn / <k@kegn.info>.gpg
Created August 19, 2017 23:35
k@kegn.info gpg key
-----BEGIN PGP PUBLIC KEY BLOCK-----
mDMEWV2z9hYJKwYBBAHaRw8BAQdAODINdbKdEu6PSW82it1KRX74Jwb+isuPATe/
1AG0y5u0G2tlZ2FuIGhpY2tzb24gPGtAa2Vnbi5pbmZvPoiWBBMWCAA+AhsDBQkD
wmcAAh4BAheAFiEEEAqmSGZUwyUS3jUtQVs4oYolEmsFAlldtJsFCwkIBwMFFQoJ
CAsFFgIDAQAACgkQQVs4oYolEmtqjwEA/M3eeAboXXto0WOgm028uLpyoNqqlkai
5YjaIrtcKK0BAL3+KP9tBB6CHh7UTXMRWKcSpwiwmvR+Nw4rBekLQkUJuDgEWV2z
9hIKKwYBBAGXVQEFAQEHQANsjg9fDOCAmuUgkc0s3rhygolHojCuAdyFhm93uRI8
AwEIB4h+BBgWCAAmFiEEEAqmSGZUwyUS3jUtQVs4oYolEmsFAllds/YCGwwFCQPC
ZwAACgkQQVs4oYolEmvZUQD/Z4GaXh6hL1RkxjnBkENMqX1WnKVwj0bUX44pK6HR
@Kegn
Kegn / pac-ghost.sh
Created August 25, 2017 00:11
modified ghost script
#!/bin/bash
# this has an orginal source that isn't me, but I don't have the link available atm. will post when I come across it.
# it has been adapted to only show one row and I removed pacman
f=3 b=4
for j in f b; do
for i in {0..7}; do
printf -v $j$i %b "\e[${!j}${i}m"
done
#!/bin/bash
# authenticate over http with wget [extremely insecure, not always supported]
wauth() {
if [[-f ./cookies.txt ]]; then
wget --load-cookies cookies.txt \
-p $1
else
wget --save-cookies cookies.txt \
@Kegn
Kegn / remote-hosts-utilities.sh
Created August 25, 2017 00:50
remote-hosts-utilities.sh
#!/bin/bash
hostinfo() {
hostnamectl >> $1
uptime >> $1
cal >> $1
w >> $1
who >> $1
id >> $1
whoami >> $1
@Kegn
Kegn / css
Created September 12, 2017 10:22
css-draft-for-blog.css
@charset "UTF-8";
/* adapted from https://github.com/edwardtufte/tufte-css/blob/gh-pages/tufte.css
*
* tufte.css
* kegn
*/
html { font-size: 12px; }
@Kegn
Kegn / btc-vs-beef.html
Last active January 13, 2018 18:56
bitcoin-beef-market-prediction
Content-Type: text/html; charset=ISO-8859-1
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Beef-vs-Bitcoin: Affordability</title>
<style type="text/css">
<!--/* <![CDATA[ */
@Kegn
Kegn / photorec-filer.sh
Last active October 8, 2019 15:43
Sorts files from photorec
#!/bin/bash
# shitty way but works kind of
# for some reason it copies them all into the first directory, so
# copy the functions into a terminal then run manually
# makes a list of filetypes from photorec recovery
# then makes a list of files
# then makes directories for each one
# then it copies the files into the appropriate folder
# start in folder with all the recup*/