Skip to content

Instantly share code, notes, and snippets.

Avatar
🏖️

Derry Pratama ibndias

🏖️
View GitHub Profile
@oskar456
oskar456 / wgcf.py
Last active Nov 25, 2021
Cloudflare WARP linux client (using wg-quick for actual tunnel setup)
View wgcf.py
#!/usr/bin/env python3
import subprocess
import json
import os
from pathlib import Path
import requests
from requests.compat import urljoin
View engine.c
#include "openssl/engine.h"
#include "openssl/evp.h"
#include "rfc1321/global.h"
#include "rfc1321/md5.h"
#define MD5_DIGEST_LENGTH 16
#define MD5_CBLOCK 64
static const char *engine_id = "MD5";
static const char *engine_name = "A simple md5 engine for demonstration purposes";
@mimoo
mimoo / erase_from_memory.h
Last active Jul 15, 2021
Include this file to get the `erase_from_memory` function that zeros memory. See https://www.cryptologie.net/article/419/zeroing-memory-compiler-optimizations-and-memset_s/
View erase_from_memory.h
#ifndef __ERASE_FROM_MEMORY_H__
#define __ERASE_FROM_MEMORY_H__ 1
#define __STDC_WANT_LIB_EXT1__ 1
#include <stdlib.h>
#include <string.h>
void *erase_from_memory(void *pointer, size_t size_data, size_t size_to_remove) {
#ifdef __STDC_LIB_EXT1__
memset_s(pointer, size_data, 0, size_to_remove);
@Vini2
Vini2 / SimpleDemoGA.java
Last active Jun 18, 2021
A simple implementation of a genetic algorithm
View SimpleDemoGA.java
import java.util.Random;
/**
*
* @author Vijini
*/
//Main class
public class SimpleDemoGA {
@gbaman
gbaman / HowToOTGFast.md
Last active Nov 25, 2021
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!
View HowToOTGFast.md

Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)

More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH i

@reaandrew
reaandrew / printbits
Created Jun 3, 2014
Print bits for a long int in C
View printbits
#include <stdio.h>
int main(){
printf("bitwise operations\n");
unsigned long int num = 10;
int i;
for(i= (sizeof(unsigned long int)*8)-1;i>= 0; i--){
char c = (num &(1LL<<i))? '1' : '0';
putchar(c);
}
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname