Skip to content

Instantly share code, notes, and snippets.

View elrikdante's full-sized avatar

Dante Haskell Elrik elrikdante

View GitHub Profile
@varenc
varenc / keyboard_leds.c
Last active June 6, 2024 00:17
Toggle the capslock light/led without actually enabling capslock! for macOS
/*
**********
2024-06-05:
On recent versions of macOS (14/Sonoma+), this code no longer works.
However I found that this project does still work: https://github.com/damieng/setledsmac/tree/master
Though if anyone knows how to fix this script I'd love to learn more.
@monadplus
monadplus / running-haskell-scripts.md
Last active February 10, 2023 19:46
Running a haskell script without GHC using nix

Updated version can be found on my website.

Running a haskell script without GHC

Given the following haskell script generate-random-samples.hs that requires mwc-random ...

{-# LANGUAGE ScopedTypeVariables #-}

import System.Random.MWC

Programmer: Atlanta, GA, No Remote, Full-Time

Layer 3 Communications is a professional services organization and network systems integrator. We use Haskell to build network security applications that revolve around either analyzing network data or configuring networks.

Networking knowledge can be learned on the job, and thus is not required.

Our stack:

  • Backend: Haskell
  • Frontend: Small amounts of JavaScript
  • Database: Postgres
@dusterio
dusterio / .js
Created October 20, 2019 08:16
Decrypting Laravel's session cookie with JavaScript and Cloudflare
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
const string2buffer = string => {
let tempArray = new Uint8Array(string.length)
for(let i = string.length; i--) tempArray[i] = string.charCodeAt(i)
return tempArray.buffer
}
@dive
dive / fix-emacs-permissions-catalina.el
Created September 29, 2019 09:55
Fix Emacs permissions on macOS Catalina
;;; package --- Fix permissions for Emacs.app on macOS Catalina
;;; Author: Artem Loenko
;;; Mail-To: <artyom.loenko@mac.com>
;;; Commentary:
;;; Code:
(defconst _default-emacs-app-plist-path "/Applications/Emacs.app/Contents/Info.plist")
(defconst _temp-buffer-name "*fixing Emacs permissions*")
(defconst _temp-buffer (get-buffer-create _temp-buffer-name))
(with-current-buffer _temp-buffer (erase-buffer))
@sonnyksimon
sonnyksimon / githubcookies.markdown
Created August 12, 2019 20:59
Cookies on GitHub
Name of Cookie Reason
user_session This cookie is used to log you in.
logged_in This cookie is used to signal to us that the user is already logged in.
dotcom_user This cookie is used to signal to us that the user is already logged in.
_gh_sess This cookie is used for temporary application and framework state between pages like what step the user is on in a mu
@mcastelino
mcastelino / slirp4netns.md
Last active September 26, 2021 17:59
slirp4netns: How does it work

Create a process with its own network and pid namespace

$ unshare --user --map-root-user --net --mount
[root@incensed-gawain ~]# echo $$
2646

Run the slirp process on the host

Binary exploitation tools

Conventions

  • <n> : user provided value
  • [n] : an optional argument, usually depending on PEDA
  • [<n>] : user provided value, but optional

gdb-peda

Get peda

Get peda with (copy-paste) :

WD=/tmp/my_tools
@jeremyhuang3627
jeremyhuang3627 / build.js
Last active October 4, 2019 18:38
Branch Library Pretty Source
(function() {// Input 0
var $jscomp = {scope:{}};
$jscomp.defineProperty = "function" == typeof Object.defineProperties ? Object.defineProperty : function(a, b, c) {
if (c.get || c.set) {
throw new TypeError("ES3 does not support getters and setters.");
}
a != Array.prototype && a != Object.prototype && (a[b] = c.value);
};
$jscomp.getGlobal = function(a) {
return "undefined" != typeof window && window === a ? a : "undefined" != typeof global && null != global ? global : a;
@maoe
maoe / TODO.md
Last active March 31, 2018 05:05
TODO for threadscope
  • Make application settings (e.g. default window size, checkboxes in the Traces tab etc) persistent

  • Switch to GTK+3 for better HiDPI support

  • Display duration in the status bar when dragging on the timeline

  • Checkbox to display/hide event markers

  • Drag support in the raw events

  • Search text in the raw events

  • Filter by thread ID (like "follow tcp stream" in wireshark)

  • Tooltip that displays the thread name or ID of the area under the cursor

  • Build index (with succinct/compact data structures) to save memory usage