Skip to content

Instantly share code, notes, and snippets.

@rampion
rampion / try-catch-ex.c
Created April 8, 2009 02:35
TRY/CATCH/FINALLY macros for C
// gcc -o try-catch-ex try-catch.c try-catch-ex.c
#include <stdio.h>
#include "try-catch.h"
// Example of use for try-catch.h
int main(int argc, char *argv[])
{
int i = 101;
printf("before try block...\n");
@jirutka
jirutka / rules-both.iptables
Created September 18, 2012 12:42
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <[email protected]>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@aras-p
aras-p / preprocessor_fun.h
Last active November 15, 2024 09:22
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,
@YamashitaRen
YamashitaRen / 10-Bit H.264
Last active June 2, 2024 04:42
10-Bit H.264 explanation
10-Bit H.264
For all those who haven’t heard of it already, here’s a quick rundown about the
newest trend in making our encodes unplayable on even more systems: So-called
high-bit-depth H.264. So, why another format, and what makes this stuff
different from what you know already?
First off: What is bit depth?
In short, bit depth is the level of precision that’s available for storing color
information. The encodes you’re used to have a precision of 8 bits (256 levels)
@avafloww
avafloww / PhpJava.java
Last active June 13, 2024 07:36
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();
@tuokri
tuokri / raw_meme_data.txt
Last active January 22, 2024 16:40
Raw meme data in text format. Generated with https://github.com/tuokri/dankparser
UNROLL THE TADPOLE OSfrog UNCLOG THE FROG OSfrog UNLOAD THE TOAD OSfrog UNINHIBIT THE RIBBIT OSfrog UNSTICK THE LICK OSfrog UNIMPRISON THE AMPHIBIAN OSfrog UNMUTE THE NEWT OSfrog UNBENCH THE KENCH OSfrog PERMIT THE KERMIT OSfrog DEFOG THE POLLIWOG OSfrog.
O-oooooooooo AAAAE-A-A-I-A-U- JO-oooooooooooo AAE-O-A-A-U-U-A- E-eee-ee-eee AAAAE-A-E-I-E-A-JO-ooo-oo-oo-oo EEEEO-A-AAA-AAAA.
╠═══╣Lets build a ladder╠═══╣.
( ͡° ͜◯ ͡°) CLOWN FIESTA ( ͡° ͜◯ ͡°).
Sodium, atomic number 11, was first isolated by Humphry Davy in 1807. A chemical component of salt, he named it Na in honor of the saltiest region on earth, North America..
EleGiggle MY BELLY IS HUGE EleGiggle MY BRAIN HAS DELAY EleGiggle YOU GUESSED IT RIGHT EleGiggle I'M FROM NA. EleGiggle.
PogChamp PogChamp HOLD CTRL AND TYPE "WTF" FOR ℱ𝓪𝓷𝓬𝔂 𝓦𝓣ℱ PogChamp PogChamp.
MingLee I MingLee KNOW MingLee WHEN MingLee THAT MingLee HOTLINE MingLee MING MingLee THAT MingLee CAN MingLee ONLY MingLee MING MingLee ONE MingLee LEE MingLee YOU MingLee USED MingLee TO MingLee MingL
@andyrbell
andyrbell / luks_backup.txt
Created March 10, 2019 14:35
clonezilla luks backup
backup luks partition
1. Boot clonezilla
2. Drop into the command line
3. open the encrypted external drive partition
cryptsetup luksOpen /dev/sda3 backup
@Edu4rdSHL
Edu4rdSHL / luks-upgrade.md
Last active August 23, 2024 06:39 — forked from kravietz/luks-upgrade.md
Ubuntu LUKS cryptsetup upgrade

If you installed your #ubuntu with full-disk #encryption a while, you may want to upgrade your #luks header version to enjoy improved #security and stronger password hashing algorithms.

Boot from USB

You can't change LUKS header from a live system - you need to boot a live Ubuntu USB to be able to access the encrypted partition. First, create a bootable USB stick using a regular Ubuntu installer image.

  • Just get the latest installer ISO available
  • You need the full installer, the mini network installer won't work
  • You may need to disable Secure Boot in BIOS temporarily to boot from USB
@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active November 16, 2024 12:34
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !