Skip to content

Instantly share code, notes, and snippets.

In a terminal, execute:
openssl req -out csr.csr -new -newkey rsa:2048 -nodes -keyout privatekey.key
Then:
openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout privatekey.key -out certificate.crt
#include <sys/resource.h>
// core dumps may be disallowed by parent of this process; change that
struct rlimit core_limits;
core_limits.rlim_cur = core_limits.rlim_max = RLIM_INFINITY;
setrlimit(RLIMIT_CORE, &core_limits);
Encrypt
% tar cz folder_to_encrypt | \
openssl enc -aes-256-cbc -e > out.tar.gz.enc
Decrypt
% openssl enc -aes-256-cbc -d -in out.tar.gz.enc | tar xz
VBoxManage clonehd --format RAW Windows_95.vdi Windows_95.img
#!/bin/sh
sudo ssh -f -N -w 0:0 my_server
sudo ifconfig tun0 192.168.1.102 pointopoint 192.168.1.101
ssh my_server sudo ifconfig tun0 192.168.1.101 pointopoint 192.168.1.102
ssh my_server sudo arp -n
sudo route add 123.456.789.123 gw 10.0.2.2 eth0
sudo route add default gw 192.168.1.101 tun0
sudo route del default gw 10.0.2.2 eth0
awk '{ if (length($0) > max) {max = length($0); maxline = $0} } END { print maxline }' FILENAME
# got from here https://developer.apple.com/library/ios/qa/qa1798/_index.html
# from binary
codesign -d --entitlements :- "Payload/YourApp.app"
# from profile
security cms -D -i "Payload/YourApp.app/embedded.mobileprovision"
sudo dscacheutil -flushcache
#!/usr/bin/env perl
use strict;
use warnings;
use autodie qw(:all);
my $str = do { local $/; <STDIN> };
$str =~ s/[^0-9a-fA-F]//gm;
$str = pack('H*', $str);
@smirn0v
smirn0v / gist:4c9f48fd2d478c16156e
Created February 10, 2016 11:00
Gerrit Create User
ssh -p 29418 smirn0v@johann gerrit create-account --email e.yurtaev@corp.mail.ru yurtaev