Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am ellcs on github.
  • I am ellcs (https://keybase.io/ellcs) on keybase.
  • I have a public key ASDjswl5NPE2o_H2ebQC2JS6mFA51iWGun7FvoeQwtbOZAo

To claim this, I am signing this object:

@ellcs
ellcs / formtastic_static_field.html.erb
Last active August 24, 2017 08:43
static field in formtastic
View formtastic_static_field.html.erb
<% # you might want to create a casual label with %>
<% # static content or content to display. %>
<% # to do, use this: %>
<li>
<legend class="label">
<label>
Static Label
</label>
</legend>
@ellcs
ellcs / NOTES_FOLDER
Last active January 23, 2019 16:11
A list of hacky commands
We couldn’t find that file to show.
@ellcs
ellcs / pg_pub_sub.rb
Created January 12, 2018 14:42 — forked from chsh/pg_pub_sub.rb
PostgreSQL LISTEN/NOTIFY example for ruby
View pg_pub_sub.rb
#
# A:
# pubsub = PgPubSub.new('channelname')
# pubsub.subscribe do |data|
# puts "data: #{data} is coming!"
# end
#
# B:
# pubsub = PgPubSub.new('channelname')
# pubsub.publish("hello world")
View gist:f9037da3ab22ccbf75f7bcda018decb9
# from http://zzapper.co.uk/vimtips.html
------------------------------------------------------------------------------
" new items marked [N] , corrected items marked [C]
" *best-searching*
/joe/e : cursor set to End of match
3/joe/e+1 : find 3rd joe cursor set to End of match plus 1 [C]
/joe/s-2 : cursor set to Start of match minus 2
/joe/+3 : find joe move cursor 3 lines down
/^joe.*fred.*bill/ : find joe AND fred AND Bill (Joe at start of line)
/^[A-J]/ : search for lines beginning with one or more A-J
@ellcs
ellcs / usb_hid_keys.h
Created March 12, 2019 18:40 — forked from MightyPork/usb_hid_keys.h
USB HID Keyboard scan codes
View usb_hid_keys.h
/**
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
*
* Created by MightyPork, 2016
* Public domain
*
* Adapted from:
* https://source.android.com/devices/input/keyboard-devices.html
*/
@ellcs
ellcs / empty_password_hash.md
Last active February 21, 2020 21:39
smb password empty hash
View empty_password_hash.md

fgdump.exe dumps hashes. It replaces null hashes with NO PASSWORD. However, when passing the hash, you should rather use aad3b435b51404eeaad3b435b51404ee.

View screenshot_i3.sh
#!/bin/bash
#
# Copyright (c) 2020 ellcs.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
@ellcs
ellcs / execve_overload.c
Created March 9, 2020 14:51
Override method in compiled file
View execve_overload.c
// Step 1) gcc -fpic -shared -o execve.so execve_overload.c
#ifndef foo_h__
#define foo_h__
#include <stdio.h>
#include "stdlib.h"
int execve(const char *filename, char *const argv[], char *const envp[]) {
puts("Overwritten. Bye!");
exit(0);
@ellcs
ellcs / all_exceptions.rb
Last active March 10, 2020 12:30
Complete ruby exception list
View all_exceptions.rb
# Public Domain
class Class
def descendants
ObjectSpace.each_object(Class).select { |klass| klass <= self }
end
def ancestor_class
ancestors[1..-1].find { |p| p.is_a?(Class) }
end