Skip to content

Instantly share code, notes, and snippets.

View einsteinx2's full-sized avatar

Ben Baron einsteinx2

View GitHub Profile
@adamgit
adamgit / .gitignore
Last active April 8, 2024 12:58
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
@mlafeldt
mlafeldt / elf.h
Last active May 5, 2024 05:35
elf.h for OSX
/* This is the original elf.h file from the GNU C Library; I only removed
the inclusion of feature.h and added definitions of __BEGIN_DECLS and
__END_DECLS as documented in
https://cmd.inp.nsk.su/old/cmd2/manuals/gnudocs/gnudocs/libtool/libtool_36.html
On macOS, simply copy the file to /usr/local/include/.
Mathias Lafeldt <mathias.lafeldt@gmail.com> */
/* This file defines standard ELF types, structures, and macros.
@rjeczalik
rjeczalik / building-static-nginx.txt
Created October 19, 2013 15:37
Notes on building nginx as a static binary.
# Building static nginx for teh lulz
#
# basic dependencies
sudo apt-get install libxslt1-dev libxml2-dev zlib1g-dev libpcre3-dev libbz2-dev libssl-dev
# download nginx and openssl
wget http://nginx.org/download/nginx-1.5.6.tar.gz
tar xf nginx-1.5.6.tar.gz; cd nginx-1.5.6
@ismell
ismell / maplebus.js
Created February 22, 2014 16:46
ScanaStudio 2 Maple Bus decoder
/* jshint loopfunc: true, undef: true, unused: false, strict: false */
/* global ch_sdcka, ch_sdckb, dec_item_add_post_text, dec_item_add_comment, hex_add_byte, dark_colors, pkt_start, pkt_end, pkt_add_item, trs_go_before, dec_item_add_data, sample_val, ui_clear, ui_add_ch_selector, dec_item_add_sample_point, DRAW_0, DRAW_1, clear_dec_items, dec_item_new, dec_item_add_pre_text, get_ui_vals, add_to_err_log, trs_get_first, trs_is_not_last, abort_requested, trs_get_next, debug, trs_go_after, sample_rate, get_ch_color */
/*
*************************************************************************************
SCANASTUDIO 2 MAPLE BUS DECODER
The following commented block allows some related informations to be displayed online
@phatfly
phatfly / cmakeAndTaglib
Last active April 25, 2024 08:45
compile taglib for iOS
I wanted to document the process that I went through to compile taglib for my iOS project.
At the time of this writing I used TagLib 1.9.1
1. Download taglib at: http://taglib.github.io/
2. Download ios-make at: github.com/plenluno/ios-cmake
3. The ios-make file that you need is in the toolchain directory. Copy the whole directory “toolchain” from inside the ios-make directory to taglib directory.
@danielpunkass
danielpunkass / fsa.py
Last active July 22, 2018 02:50
A simple lldb module for adding an "fsa" command to inject F-Script anywhere into any process
"""
Automate loading of F-Script Anywhere into any app.
By Daniel Jalkut - @danielpunkass - http://indiestack.com/
To set up:
0. Make sure you have FScript.framework installed in /Library/Frameworks (http://www.fscript.org)
1. Copy this script to ~/.lldb/fsa.py
2. Add the following to your ~/.lldbinit file:
@plepe
plepe / gist:52ecc9f18efb32c68d18
Last active October 23, 2023 08:50
MDADM and LVM cheat sheet

mdadm

Glossary:

  • md: multiple devices
command description
cat /proc/mdstat show status of all raids
mdadm --detail /dev/md0 detailed status of raid md0
@kristopherjohnson
kristopherjohnson / locking.swift
Last active June 5, 2021 03:04
Simple synchronization functions for Swift, wrapping the Cocoa NSLocking classes
import Foundation
/// Protocol for NSLocking objects that also provide tryLock()
public protocol TryLockable: NSLocking {
func tryLock() -> Bool
}
// These Cocoa classes have tryLock()
extension NSLock: TryLockable {}
extension NSRecursiveLock: TryLockable {}
@himenlinamarbric
himenlinamarbric / spotifyHijack.scpt
Last active September 20, 2022 18:58
Audio Hijack Pro & Spotify -- No Polling
-- Usage
-- 1. Edit the settings (see below). This step is NECESSARY the first time you use it!
-- 2. Run this script (this should open Audio Hijack Pro and Spotify)
--
-- NOTE: the script assumes that each track is played entirely. You CANNOT skip tracks in Spotify.
-- If you do so the script will get out of sync and the resulting files contain partial or multiple songs.
-- You can abort a recordig session by stopping this script and ending (manually) the recording
-- in Audio Hijack Pro.
--
-- You need to have "atomicparsley" installed on your system. You can install the application with
@luckydev
luckydev / gist:b2a6ebe793aeacf50ff15331fb3b519d
Last active October 22, 2022 14:03
Increate max no of open files limit in Ubuntu 16.04/18.04 for Nginx
# maximum capability of system
user@ubuntu:~$ cat /proc/sys/fs/file-max
708444
# available limit
user@ubuntu:~$ ulimit -n
1024
# To increase the available limit to say 200000
user@ubuntu:~$ sudo vim /etc/sysctl.conf