Skip to content

Instantly share code, notes, and snippets.

View tomekr's full-sized avatar

Tomek Rabczak tomekr

View GitHub Profile
@tomekr
tomekr / application_template.rb
Last active July 25, 2022 05:11
Run this with "rails new [app_name] --css tailwind -T -m [link to this file]"
SEED_USER_EMAIL = "user@example.com"
SEED_USER_PASSWORD = "password"
def add_gems
# Add testing gems
gem_group :development, :test do
gem 'rspec-rails'
gem 'factory_bot_rails'
gem 'capybara'
gem 'webdrivers'
@tomekr
tomekr / starfield.frag
Created February 16, 2021 00:08
Starfield background for a bevy shader background
#version 450
#define M_PI 3.1415926535897932384626433832795
layout(location = 0) in vec4 v_Position;
layout(location = 1) in vec2 v_Uv;
layout(location = 0) out vec4 o_Target;
layout(set = 2, binding = 0) uniform ShaderInputs_time {
float time;
@tomekr
tomekr / cell_flute_synth.rb
Created November 12, 2017 16:28
Sonic Pi code that uses Wolfram's Rule 30 1D Cellular Automaton to generate a melody+rhythm
x = "/Users/Dev/sonic_pi/Music Hack/samples/Fluteloop.wav"
def converter(desired, original)
output = (2 ** ((desired - original) / 12.0)) / 2
end
class Chord
def initialize(key, root, custom = false)
modes = [[0, 2, 4, 5, 7, 9, 11],
[0, 2, 3, 5, 7, 9, 10],
[0, 1, 3, 5, 7, 8, 10],
@tomekr
tomekr / webgoat_docker.log
Created April 8, 2017 18:21
webgoat docker log
2017-04-08 18:19:50,550 DEBUG - request: SecurityContextHolderAwareRequestWrapper[ org.springframework.security.web.context.HttpSessionSecurityContextRepository$Servlet3SaveToSessionRequestWrapper@327b42e1]
2017-04-08 18:19:50,550 DEBUG - principle: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@bbf4aed: Principal: org.springframework.security.core.userdetails.User@48f4806f: Username: webgoat; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ROLE_WEBGOAT_ADMIN; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@fffd3270: RemoteIpAddress: 172.17.0.1; SessionId: 5B3BFADD84C01ABD5F7CA8614E72DB28; Granted Authorities: ROLE_WEBGOAT_ADMIN
2017-04-08 18:19:50,550 DEBUG - HH Entering Session_id: B6A0AF7CFD522C5DC4481BEB50FEB6BA
Hacked admin
2017-04-08 18:19:50,551 INFO - PARM MAP: {Screen=[Ljava.lang.String;@959919b, men
@tomekr
tomekr / pocorgtfo_index.tsv
Last active April 6, 2021 08:34
An index of International Journal of Proof-of-Concept or Get The Fuck Out
Issue Title Alternate Title Author
0x00 2 iPod Antiforensics Travis Goodspeed
0x00 3 ELFs are dorky, Elves are cool Sergey Bratus, Julian Bangert
0x00 4 The Pastor Manul Laphroaig's First Epistle to Hacker Preachers of All Hats, in the sincerest hope that we might shut up about hats, and get back to hacking. Manul Laphroaig
0x00 5 Returning from ELF to Libc Rebecca "Bx" Shapiro
0x00 6 GTFO or #FAIL FX of Phenoelit
0x01 2 Four Lines of Javascript that Can’t Possibly Work So why do they? Dan Kaminsky
0x01 3 Weird Machines from Serena Butler’s TV Typewriter Travis Goodspeed
0x01 4 Making a Multi-Windows PE Ange Albertini
0x01 5 This ZIP is also a PDF Julia Wolf
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int result[6][2];
parseMessage("881&11|900&22|950&33|975&44|1000&55|1071&66$", result);
#include "LPD8806.h"
#include "SPI.h"
#include "RGBConverter.h"
// Simple test for 160 (5 meters) of LPD8806-based RGB LED strip
// Not compatible with Trinket/Gemma due to limited RAM
/*****************************************************************************/
➜ chicago-science-hack-day python osmocom_spectrum_sense.py 100 105
Mac OS; Clang version 6.1.0 (clang-602.0.53); Boost_105800; UHD_003.008.005-0-unknown
Warning: this may have issues on some machines+Python version combinations to seg fault due to the callback in bin_statitics.
gr-osmosdr 0.1.4 (0.1.4) gnuradio 3.7.7
built-in source types: file fcd rtl rtl_tcp uhd hackrf rfspace
Using HackRF One with firmware 2014.08.1
Using Volk machine: avx_64_mmx_orc
gain = 7.0
@tomekr
tomekr / system.py
Created June 15, 2015 22:23
system.py
# If ctypes is available, use it to find system routines for UUID generation.
_uuid_generate_random = _uuid_generate_time = _UuidCreate = None
try:
import ctypes, ctypes.util
# The uuid_generate_* routines are provided by libuuid on at least
# Linux and FreeBSD, and provided by libc on Mac OS X.
for libname in ['uuid', 'c']:
try:
lib = ctypes.CDLL(ctypes.util.find_library(libname))