Skip to content

Instantly share code, notes, and snippets.

View mika's full-sized avatar

Michael Prokop mika

View GitHub Profile
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active May 9, 2024 20:00
Hyperlinks in Terminal Emulators
@zeha
zeha / gist:3d4f6e69a809e4411927
Created December 2, 2015 00:46
single lvm2 LV to plain partition
LVM2 partition previously began on sector 2048
Offset 1048576 = 2048 * 512
dmsetup table shows where LV begins, usually at offset 2048 (unit=sectors), -> new partition starts at sector 4096!
Don't forget to update-grub (check root=UUID=<uuid of ext4>) and grub-install /dev/vda after making these changes!
# fdisk -l
Disk /dev/vda: 32 GiB, 34359738368 bytes, 67108864 sectors
@hubert3
hubert3 / samsung_hash_crack.py
Last active November 22, 2022 09:12
Python implementation of passcode hashing algorithm used on the Samsung Galaxy S4 GT-I9505 4.2.2
#!/usr/bin/python
'''
Python implementation of passcode hashing algorithm used on the Samsung Galaxy S4 GT-I9505 4.2.2
Correct PIN for hash and salt below is 1234.
Get 40-character hash value in ascii hex format from file /data/system/password.key on the phone
Get salt in signed numeric format by doing sqlite3 query SELECT value FROM locksettings WHERE name = 'lockscreen.password_salt' on /data/system/locksettings.db
@chmouel
chmouel / git-jenkins-error.py
Last active January 1, 2016 20:09
Script that will get the failed jobs and save the console.html (to /tmp) This probably will work only on OpenStack Gerrit/Jenkins infra.
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# Simple launch gerrit-jenkins-error inside a git repo would get the failed
# job for the current commit (using the changeId) or you can add an
# argument be it the change-id the review number or even something
# like https://review.openstack.org/#/c/101010/ and it would do the
# right thing™
#
# Use the -t option to specify the output to something than /tmp
@jordansissel
jordansissel / gist:8031741
Created December 18, 2013 23:35
One-liner to find git commits with files larger than 300kb
% git rev-list HEAD | xargs -n1 sh -c 'git ls-tree -lr $1 | awk "\$4 > (300*1024) { print \"size:\",\$4, \$5 }" | sed -e "s,^,commit:$1 ,"' -
commit:fd93322c903a49febe8ad454c9e03a7e86327389 size: 69535125 debian/debian/logstash.war
@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet
@aras-p
aras-p / preprocessor_fun.h
Last active May 8, 2024 06:45
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@damphat
damphat / apt-rdepends-tree
Last active December 16, 2023 01:38
debian dependency tree
#! /bin/bash
# Description: show dependency tree
# Author: damphat
if [ $# != 1 ]; then
echo 'Usage: apt-rdepends-tree <package>'
echo 'Required packages: apt-rdepends'
exit 1
fi
@noprompt
noprompt / word-re.txt
Last active May 2, 2016 15:30
Regular expression for matching any word in `/usr/share/dict/words`.
This file has been truncated, but you can view the full file.
(?:s(?:(?:u(?:b(?:(?:s(?:t(?:a(?:n(?:t(?:i(?:a(?:l(?:(?:i(?:s[mt]|a|ty|ze)|ly|ness))?|t(?:i(?:on|ve)|e|or)|bility)|v(?:e(?:(?:ly|ness))?|al(?:ly)?|i(?:ty|ze))|fy|ous|ze))?|c(?:e(?:less)?|h)|dard(?:ize)?)|lagmit(?:e|ic)|ge|tion)|r(?:a(?:t(?:o(?:s(?:pher(?:e|ic)|e)|r)|i(?:ve)?|al|e|um)|ct(?:ion)?)|uct(?:(?:ion(?:al)?|ur(?:al|e)))?|iate)|itu(?:t(?:i(?:on(?:a(?:l(?:ly)?|ry))?|ng(?:ly)?|ve(?:ly)?)|e(?:[dr])?|able)|ent)|o(?:r(?:eroom|y)|ck)|yl(?:ar|e)|ernal)|e(?:[ta]|r(?:v(?:i(?:en(?:t(?:(?:ly|ness))?|c[ey])|ate)|e)|o(?:sa|us)|ies|rate)|c(?:u(?:t(?:e|ive)|rity)|retar(?:ial|y)|t(?:ion)?|ive)|quen(?:t(?:(?:ial(?:ly)?|ly|ness))?|c[ey])|ns(?:u(?:al|ous)|ation|ible)|pt(?:uple)?|mi(?:fusa|tone)|xtuple|wer|ssile|gment)|i(?:d(?:i(?:ar(?:i(?:e|ly|ness)|y)|z(?:a(?:ble|tion)|e(?:r)?)|ng|st)|e(?:(?:n(?:c[ey]|t)|r))?|y)|st(?:(?:en(?:c[ey]|t(?:ial)?)|ingly))?|l(?:ic(?:ate|ic)|l)|m(?:i(?:lation|ous)|ple)|zar(?:ship)?|nuous)|c(?:ri(?:pt(?:(?:i(?:on(?:ist)?|ve(?:ly)?)|ure))?|b(?:e(?:r(?:ship)?)?|able)|ve(?:r)?)|apular(?:(?:is|y))?|
@MattSurabian
MattSurabian / PackerPolicy.json
Last active May 27, 2022 21:46
Minimum IAM policy required by AWS for Packer to do its thing. https://github.com/mitchellh/packer Permissions are broken out by API functionality and a resource array has been defined with a wild card for each group. For tighter security resource level permissions can be applied per this documentation: http://aws.typepad.com/aws/2013/07/resourc…
{
"Statement": [
{
"Sid": "PackerSecurityGroupAccess",
"Action": [
"ec2:CreateSecurityGroup",
"ec2:DeleteSecurityGroup",
"ec2:DescribeSecurityGroups",
"ec2:AuthorizeSecurityGroupIngress",
"ec2:RevokeSecurityGroupIngress"