Skip to content

Instantly share code, notes, and snippets.

View samrocketman's full-sized avatar

Sam Gleske samrocketman

View GitHub Profile
@samrocketman
samrocketman / rsa_decrypt.groovy
Last active December 3, 2018 13:09
Jenkins script console decrypt base64 encoded string
//http://www.mysamplecode.com/2011/08/java-rsa-encrypt-string-using-bouncy.html
import jenkins.bouncycastle.api.PEMEncodable
import static jenkins.bouncycastle.api.PEMEncodable.decode
import hudson.util.Secret
import java.util.Base64
import org.bouncycastle.crypto.engines.RSAEngine
import org.bouncycastle.crypto.AsymmetricBlockCipher
import org.bouncycastle.crypto.params.AsymmetricKeyParameter
@samrocketman
samrocketman / output.txt
Last active May 8, 2017 16:56
Test fetch-content.sh when no download utilities are available. Ref: https://github.com/OpenRA/ra2/pull/385
$ ./test-fetch-content.sh
INFO: Preparing $PATH
INFO: Linked /bin/bash
INFO: Linked /bin/ls
INFO: Linked /usr/bin/7z
INFO: Linked /bin/mkdir
INFO: Linked /bin/rm
INFO: Linked /usr/bin/[
INFO: Execute fetch-content.sh with PATH=/tmp/tmp.fWWXp8A7sN
+ set -e
@samrocketman
samrocketman / clean_up_branches.md
Created April 5, 2017 16:41
Clean up git branches

Fetch the branches

From a remote repository fetch branches.

mkdir ~/sandbox
cd ~/sandbox
git clone your-repository
cd your-repository/
git checkout origin/master
@samrocketman
samrocketman / compromised_accounts.js
Last active January 31, 2017 22:15
2055538028 compromised accounts from 187 services. (2 billion accounts)
//run the following using Firefox Firebug on
//https://haveibeenpwned.com/PwnedWebsites
//2055538028 compromised accounts from 187 services. (2 billion accounts)
//http://stackoverflow.com/questions/1144783/how-to-replace-all-occurrences-of-a-string-in-javascript
String.prototype.replaceAll = function(search, replacement) {
var target = this;
return target.replace(new RegExp(search, 'g'), replacement);
};
@samrocketman
samrocketman / libimobiledevice_ifuse_Ubuntu.md
Last active January 11, 2024 22:47
On Ubuntu 16.04, since iOS 10 update, libimobiledevice can't connect to my iPhone. This is my attempt to document a fix.

Why this document?

I upgraded my iPhone 5s to iOS 10 and could no longer retrieve photos from it. This was unacceptable for me so I worked at achieving retrieving my photos. This document is my story (on Ubuntu 16.04).

The solution is to compile libimobiledevice and ifuse from source.

Audience

Who is this guide intended for?

@samrocketman
samrocketman / setup_thinkpad.md
Created October 21, 2016 07:03
Set up lenovo thinkpad.

First steps

Here's some first steps I took to set up the Lenovo ThinkPad X200.

#upgrade system packages to latest revisions
apt-get update
apt-get upgrade
apt-get install -y linux-generic linux-headers-generic linux-image-generic ubuntu-core-launcher
@samrocketman
samrocketman / SENA_Linux.md
Last active February 22, 2023 14:41
Connecting my SENA device via USB on Linux to update the firmware

Update SENA from Linux

In May, 2016, I completely switched all of my home computing environments to Linux. As a result, I've had to find workarounds for things which require Windows. This article outlines my first attempt to update my SENA 10S helmet communicator from KUbuntu 16.04 Linux.

What works and what doesn't

If you follow this guide, I'll state up front what success you'll expect.

  • Installing the Sena Device Manager works.
  • Connecting SENA 10S via USB works.
@samrocketman
samrocketman / KUbuntu_RAID0.md
Last active July 17, 2021 15:31
Configure KUbuntu 16.04 with RAID0

Notes for my system:

  • I couldn't get legacy boot to work. Only UEFI (using an EFI System Partition aka EPS).
  • The EPS can't be on the RAID0. You must allocate ~200 megabytes to the EPS.
  • KUbuntu installer was so buggy that I couldn't use it. Use Ubuntu to set up the system and then install kubuntu-desktop package.
  • When chrooting the EPS must be mounted on /boot/efi.
  • I recommend using Ubuntu 16.04 inside of virtualbox to create a startup boot disk on USB of Ubuntu 16.04 ISO. At first a tried using an earlier version of KUbuntu and it took a lot of trial/error to discover I shouldn't have done that.

Resources:

@samrocketman
samrocketman / doppler_heal.py
Last active May 6, 2016 05:16
http://www.sikuli.org/ doppler_heal.sikuli script. Spins mouse in a circle from a central point in your game. e.g. your space ship.
#doppler heal with hotkeys
#Created by Sam Gleske
#https://gist.github.com/samrocketman/12057af8bbf1463ca2a6
#rev 35
################################################################################
#DOCUMENTATION
# About this program
# This program is designed to add hotkey functionality to my game.
# Additionally, it augments my ability to play using more keyboard shortcuts
@samrocketman
samrocketman / .gitignore
Last active November 25, 2015 21:44
Using xargs to process multiple arguments and commands in parallel. Use case is for software that does not take advantage of multiple cores processing independent data. This means data can be split and processed separately.
/tmp