Skip to content

Instantly share code, notes, and snippets.

View deadPix3l's full-sized avatar
👻

Skyler Curtis deadPix3l

👻
View GitHub Profile
@deadPix3l
deadPix3l / popen3
Created March 13, 2015 00:43
popen3 loops
import os
#define x and y here i guess
for i in xrange(x,y):
(out, err) = os.popen3('cmd -s %s --switch2 %s' %(i, blah))[1:]
#Note: [1:] excludes [0], stdin, because I don't care for it.
#printing out to outfile and err to .errfile goes here
#code excluded because its not the main focus here
@deadPix3l
deadPix3l / aliases
Last active March 16, 2017 18:16
aliases that i havent gotten around to adding yet
##################
# PS1 uses #
##################
PS1a - \u@\h\$
PS1b - "\$ "
###########################
# useful utilities #
###########################
ping8 - ping -c4 8.8.8.8
@deadPix3l
deadPix3l / curses.py
Created March 10, 2017 14:37
Curses cheatsheet
#!/usr/bin/env python
import curses
# see 2/howto/curses.html for info.
# look into curses.textpad, which turns a window into a textbox with bindings
# look into curses.ascii for easier char handing
# the curses magical setup
stdscr = curses.initscr() # setup intial window
curses.noecho() # dont echo keystrokes
-- HUMAN RESOURCE MACHINE PROGRAM --
init:
COPYFROM 24
COPYTO 22
BUMPUP 22
BUMPUP 22
COMMENT 0
main:
COPYFROM 22
@deadPix3l
deadPix3l / elevator.js
Created June 7, 2017 17:56
Elevator saga
{
init: function(elevators, floors) {
elevators.forEach(function(x, index){
x.on("floor_button_pressed", function(floorNum) {
if (x.currentFloor() > floorNum) {
x.goingDownIndicator(true);
x.goingUpIndicator(false);
@deadPix3l
deadPix3l / docker-compose.yml
Created March 7, 2018 19:37
docker-compose ELK
version: '3'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.2.2
container_name: elasticsearch
environment:
- cluster.name=docker-cluster
- discovery.type=single-node
@deadPix3l
deadPix3l / .conkyrc
Created March 7, 2018 19:41
rings.conky
# -- Conky settings -- #
background no
update_interval 1
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
double_buffer yes
@deadPix3l
deadPix3l / snip-ideas.md
Created September 19, 2018 23:06
snippets ideas

these are ideas that arent good enough to deserve their own repo or a significant amount of time dedicated to them. They are semi decnet ideas that i would like, but are kinda lowest priority for when im super bored.

  • last.fm pandora scrobbling bookmarklet.
#include <stdio.h> //printf
#include <stdlib.h> // remove()
#include <unistd.h> // sleep()
int main(int argc, char** argv) {
remove(argv[0]);
while(1) {
printf("running in mem only\n");
sleep(2);
def fib(n):
if n<=1:
return 1
return fib(n-1) + fib(n-2)