Skip to content

Instantly share code, notes, and snippets.

@msantos
msantos / bpf.c
Last active April 2, 2024 18:54
Example of using bpf to capture packets
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <err.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active June 6, 2024 22:59
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@Chrisedmo
Chrisedmo / Mountain Lion tweaks
Created July 30, 2012 14:30
Mountain Lion tweaks (under the hood)
# ~/.osx — http://mths.be/osx
###############################################################################
# General UI/UX #
###############################################################################
# Set computer name (as done via System Preferences → Sharing)
scutil --set ComputerName "MathBook Pro"
scutil --set HostName "MathBook Pro"
scutil --set LocalHostName "MathBook-Pro"
println("Hello")
var conn = Socket().connect(8000, address: "127.0.0.1").listen(limit:128).accept() { connection, address in
println("Accepted a connection from port \(address.addressString)")
return connection
}.read() { connection, inStr in
let arr = inStr.componentsSeparatedByString("\n")
let response = (arr[0].uppercaseString + "\n")
return connection.write(response)
}.close()
@jedi4ever
jedi4ever / upload-to-appstore.sh
Created August 18, 2014 12:13
Command upload App/Ipa to the iTunes Connect App Store
#!/bin/bash
set -ex
# This scripts allows you to upload a binary to the iTunes Connect Store and do it for a specific app_id
# Because when you have multiple apps in status for download, xcodebuild upload will complain that multiple apps are in wait status
# Requires application loader to be installed
# See https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/SubmittingTheApp.html
# Itunes Connect username & password
USER=bla
@devbug
devbug / CCTogglesAgent.xm
Created November 25, 2014 19:05
app activation with bypassing passcode lock on iOS 7.x (CCToggles)
// ...
- (SBWorkspace *)sbWorkspace {
return g_sbWorkspace;
}
- (BOOL)launchApplication:(NSString *)identifier {
return [self launchApplication:identifier url:nil];
}
@JadenGeller
JadenGeller / Arbitrary Precision and Arbitrary Base Integers Example.swift
Last active September 30, 2023 00:48
Swift Arbitrary Precision, Arbitrary Base Integers
// Use an integer literal to instantiate
let a: BigInt = 23559821412349283
// Or use a string literal if you want to start with a number that is greater than IntMax
let b: BigInt = "123456789876543234567876543234567876543"
// Perform arithmetic operations
let c: BigInt = 123456 + 321 // -> 12777
let d = c / 100 // -> 127
let e = d << d // -> 12700000000......(127 zeros)
@marteinn
marteinn / progamatically-popover-example.m
Last active January 15, 2022 12:13
NSPopover Example: Create and show a NSPopover programmatically when a user clicks a button in a subview
-(void) buttonClick:(NSButton *)sender {
// Create view controller
EXPopoverViewController *viewController = [[EXPopoverViewController alloc] init];
// Create popover
NSPopover *entryPopover = [[NSPopover alloc] init];
[entryPopover setContentSize:NSMakeSize(200.0, 200.0)];
[entryPopover setBehavior:NSPopoverBehaviorTransient];
[entryPopover setAnimates:YES];
[entryPopover setContentViewController:viewController];
@Arinerron
Arinerron / root.sh
Last active March 7, 2024 09:24
"Root" via dirtyc0w privilege escalation exploit (automation script) / Android (32 bit)
#!/bin/bash
# Give the usual warning.
clear;
echo "[INFO] Automated Android root script started.\n\n[WARN] Exploit requires sdk module \"NDK\".\nFor more information, visit the installation guide @ https://goo.gl/E2nmLF\n[INFO] Press Ctrl+C to stop the script if you need to install the NDK module. Waiting 10 seconds...";
sleep 10;
clear;
# Download and extract exploit files.
echo "[INFO] Downloading exploit files from GitHub...";
@luismachado
luismachado / FadeScrollView.swift
Created June 23, 2017 13:53
Custom UIScrollView with fade effect
//
// FadeScrollView.swift
//
// Created by Luís Machado on 23/06/2017.
// Copyright © 2017 Luis Machado. All rights reserved.
//
import UIKit
class FadeScrollView: UIScrollView, UIScrollViewDelegate {