Skip to content

Instantly share code, notes, and snippets.

Avatar

Stelios Petrakis stelabouras

View GitHub Profile
@stelabouras
stelabouras / killbutmakeitlooklikeanaccident.sh
Created Jul 17, 2022 — forked from moyix/killbutmakeitlooklikeanaccident.sh
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
View killbutmakeitlooklikeanaccident.sh
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'
View aps_certificates_howto.md

After requesting the certificate from Apple (to do this, go to Apple Developer site -> APNs Auth key -> [+]), download the .cer file (usually named aps_production.cer or aps_development.cer) from the iOS Provisioning Portal, save in a clean directory, and import it into Keychain Access.

It should now appear in the keyring under the "Certificates" category, as Apple Push Services. Inside the certificate you should see a private key (only when filtering for the "Certificates" category).

Export this private key as a .p12 file:

  • Right click in the certificate we are interested in Keychain and select Export...
  • Accept the default .p12 file format and then click Save
View gist:8a1b77c7e22477b16910a8ca4d668dcc
### Keybase proof
I hereby claim:
* I am stelabouras on github.
* I am stelabouras (https://keybase.io/stelabouras) on keybase.
* I have a public key ASC9De02SA-hb_vYJnupknTZGfbod_wq_Dctx0rhbZ51uwo
To claim this, I am signing this object:
@stelabouras
stelabouras / HorizonSample.m
Last active Feb 27, 2020
Horizon SDK sample
View HorizonSample.m
// Initialize the camera
HVTCamera *camera = [HVTCamera new];
// Create a simple view
HVTView *videoPreview = [[HVTView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];
videoPreview.center = self.view.center;
[self.view addSubview:videoPreview];
// Attach this view to your camera
[camera addView:videoPreview];
@stelabouras
stelabouras / loadAssetToInstagram.m
Last active Mar 18, 2021
Loads a Camera Roll Asset to Instagram (works for both photos & videos)
View loadAssetToInstagram.m
- (void)loadCameraRollAssetToInstagram:(NSURL*)assetsLibraryURL andMessage:(NSString*)message
{
NSString *escapedString = [assetsLibraryURL.absoluteString urlencodedString];
NSString *escapedCaption = [message urlencodedString];
NSURL *instagramURL = [NSURL URLWithString:[NSString stringWithFormat:@"instagram://library?AssetPath=%@&InstagramCaption=%@", escapedString, escapedCaption]];
[[UIApplication sharedApplication] openURL:instagramURL];
}
@stelabouras
stelabouras / downloadFromBasecamp.php
Last active Feb 27, 2020
Download all your file from Basecamp and organise them in folders
View downloadFromBasecamp.php
<?
// make sure the folder of the script is writeble (0777)
$basecampUrl = '[YOUR BASECAMP URL HERE]'; // e.g. https://stelabouras.basecamphq.com/ (Don't forget the trailing slash!)
$apiKey = '[YOUR API KEY HERE]'; // e.g. one huge string (found in 'My info' in the Authentication tokens section)
function BasecampCall($endPoint, $usePrefix = true) {
global $apiKey, $basecampUrl;
// From: http://prattski.com/2008/10/22/basecamp-api-examples-using-php-and-curl-get/
@stelabouras
stelabouras / storeMinecraftToDropbox.sh
Last active Feb 27, 2020
Create a link from your Dropbox saves to your MineCraft saves
View storeMinecraftToDropbox.sh
ln -s /[path to your Dropbox directory]/Minecraft/saves /Users/[your MacOSX username]/Library/Application\ Support/minecraft/
@stelabouras
stelabouras / eraseTumblrPosts.php
Last active Feb 27, 2020
Erase all your posts from your Tumblr account
View eraseTumblrPosts.php
<?php
// ------WARNING------
// RUNNING THIS FILE WITH THE APPROPRIATE CREDENTIALS WILL
// ERASE ALL YOUR POSTS FROM YOUR TUMBLR BLOG!
// Tumblr Blog Info
//replace YOUR-TUMBLR-EMAIL with the email you are using to login to Tumblr
$tumblrEmail = 'YOUR-TUMBLR-EMAIL';