Skip to content

Instantly share code, notes, and snippets.

View cyphunk's full-sized avatar

Nathan Fain cyphunk

  • stage theatre + reverse engineering
View GitHub Profile
@cyphunk
cyphunk / bot_example.py
Created April 11, 2019 18:18 — forked from Vexs/bot_example.py
A Cogs Example for the rewrite version of - discord.py
import discord
from discord.ext import commands
import sys, traceback
"""This is a multi file example showcasing many features of the command extension and the use of cogs.
These are examples only and are not intended to be used as a fully functioning bot. Rather they should give you a basic
understanding and platform for creating your own bot.
These examples make use of Python 3.6.2 and the rewrite version on the lib.
@cyphunk
cyphunk / sudostrict.sh
Last active March 22, 2019 12:56
sudostrict alerts when target program or script can be edited by non-root user
# This wrapper alerts user when target is non-root editable.
#
# sudo is most often used to run command or script with root privileges.
# IF target program or script being run is editable by non-root
# THEN a privilege escilation attack is exposed.
# e.g. an attacker that has gained access to users enviornment could then
# use a non-root editable program/script to elivate to root.
#
# IMPORTANT: be certain where this code is stored and loaded is only
# editable by root user.

A Film About Feedback

https://vimeo.com/97319636 The DasArts feedback method

Authors

  • co-author karim benammar (another video on his feedback methods https://vimeo.com/193295732)
  • co-author Georg Weinand
  • co-author Barbara Van Lindt (DasArts managing director)
  • co-author Juul Beeren (DasArts counsellor)
@cyphunk
cyphunk / Makefile
Created September 3, 2018 11:13 — forked from f0rki/Makefile
Can you LD_PRELOAD from noexec mounted directory?
all: test preload.so
clean:
-$(RM) test preload.so
%.so: %.c
$(CC) $^ -o $@ -shared -fPIC $(CFLAGS)
@cyphunk
cyphunk / inheritance.js
Created December 6, 2017 17:07
bloody js
var Worker = function (name) {
this.name = name;
this.mcount = 0;
this.mcounter = function() {
++this.mcount;
console.log("mcount",this.name,this.mcount)
}
this.mmcount = 0;
this.mmcounter = function() {
this.constructor.prototype.mmcount+=1;
@cyphunk
cyphunk / FastLED_Serial_Proxy.ino
Last active September 4, 2017 15:18
LED Proxy for Cuckoo rice cooker in Cuckoo theatre sohw
#include "FastLED.h"
#define NUM_LEDS 8
#define DATA_PIN PIN_D6
#define BRIGHTNESS 255
#define FRAMES_PER_SECOND 120
#define HEARTBEAT_MILLIS 5000
#define HEARTBEAT_CHAR "A"
bool DEBUG = 0;
@cyphunk
cyphunk / toggleit.sh
Created May 9, 2017 10:31
create a visor for file manager or other apps
#/bin/bash
# given a window name, toggle visability
# map this to a short cut key
# based on https://stackoverflow.com/questions/12056898/use-dolphin-or-other-browser-like-yakuake
# https://bbs.archlinux.org/viewtopic.php?id=71789&p=1
command -v xdotool >/dev/null || echo "Error: install xdotool"
@cyphunk
cyphunk / print.sh
Last active February 7, 2019 17:40
sick of printer managers
#!/usr/bin/env bash
# setup and destroy printer
# sudo call integrity check: only root should be able to change script
l=($(/usr/bin/ls -l `/usr/bin/readlink -f $0`))
[ ${l[0]:2:1} != "-" ] && [ "${l[2]}" != "root" ] ||
[ ${l[0]:5:1} != "-" ] && [ "${l[3]}" != "root" ] ||
[ ${l[0]:8:1} != "-" ] && { echo -e "only root should be able to modify\n${l[@]}"; exit 1;}
read -p "Setup printer? [y]/n " YN
general {
colors = true
interval = 5
color_good = "#334433"
color_bad = "#443333"
color_separator = "#111111"
}
#order += "ipv6"
#order += "disk /"
@cyphunk
cyphunk / softmax.js
Last active April 6, 2024 11:21 — forked from vladimir-ivanov/softmax.js
softmax function implementation in js
// Fork & examples for the one-line version by @vladimir-ivanov:
//let softmax = (arr) => (index) => Math.exp(arr[index]) / arr.map(y => Math.exp(y)).reduce((a, b) => a + b);
//
// Also see comments for improvements
function softmax(arr) {
return arr.map(function(value,index) {
return Math.exp(value) / arr.map( function(y /*value*/){ return Math.exp(y) } ).reduce( function(a,b){ return a+b })
})
}