Skip to content

Instantly share code, notes, and snippets.

View diorahman's full-sized avatar

Dhi Aurrahman diorahman

  • Cokelatia
  • Bandung
View GitHub Profile
@diorahman
diorahman / self.md
Last active May 1, 2024 05:57
CUDA Books: Self taught
@diorahman
diorahman / MOUNT.md
Last active April 1, 2024 18:49
Mount *.vdi of VirtualBox using qemu-nbd

Install qemu-kvm

sudo apt install qemu-kvm
sudo rmmod nbd
sudo modprobe nbd max_part=16
sudo qemu-nbd -c /dev/nbd0 drive.vdi
sudo mount /dev/nbd0p1 /mnt
//---------------------------------------------------------------------------------------
// Copyright (c) 2001-2014 by PDFTron Systems Inc. All Rights Reserved.
// Consult legal.txt regarding legal and license information.
//---------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------
// This sample demonstrates the basic usage of high-level digital signature API in PDFNet.
//
// The following steps are typically used to add a digital signature to a PDF:
//
@diorahman
diorahman / client.html
Created December 26, 2011 03:34
Ajax, call jQuery POST to node.js expressjs
<html>
<head>
<title>jsonp test</title>
<script src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
<script type="text/javascript">
$(function(){
$('#select_link').click(function(e){
e.preventDefault();
console.log('select_link clicked');
$ openssl req -x509 -nodes -newkey rsa:1024 -keyout keyfile.key -out certificate.cer
$ echo "hello!" > data.txt
$ openssl smime -sign -md sha1 \
> -binary -nocerts -noattr \
> -in data.txt -out data.txt.signed -outform der \
> -inkey keyfile.key \
> -signer certificate.cer
$ openssl asn1parse -inform der -in data.txt.signed
$ hexdump -C data.txt
@diorahman
diorahman / linux-kernel-make-menuconfig-yosemite.md
Last active March 15, 2023 12:36
Run linux kernel make menuconfig on osx yosemite

osx

install ncurses, via $ brew install ncurses

edit the scripts/kconfig/Makefile, put HOSTLOADLIBES_mconf += -L/usr/local/opt/ncurses/lib -ltinfo, where the libtinfo.dylib is just a symlink to libncurses.dylib

hit the scripts/kconfig/lxdialog/check-lxdialog.sh, this is ugly!

#!/bin/sh
@diorahman
diorahman / gist:3719590
Created September 14, 2012 03:17
komentar
"If I ever have to sink down over sweets and chocolate, let it be as good as #RockyBars.."
~Riana Ambarsari (@p3nnylan3, blogger, food-photograpy, pentolan NCC)
https://twitter.com/p3nnylan3/statuses/210674735137292288
"Helo @cokelatia this #rockybars is heaven!! :9 http://lockerz.com/s/243806752"
~Artasya Sudirman (@myARTasya, broadcaster Selera Kita Show @motion975fm)
https://twitter.com/myartasya/status/246044914255810561
"Ngabisin #RockyBars sendirian bukan berarti maruk. Tapi emang gak bs aja liat makanan nyisa"
~Irlanda (@irrrlanda, dokter gigi)
@diorahman
diorahman / ws-client.go
Created July 21, 2015 01:53
golang websocket example with basic auth
package main
import (
"log"
"net/http"
"encoding/json"
"golang.org/x/net/websocket"
"fmt"
)
@diorahman
diorahman / rekening.md
Last active December 21, 2020 00:44
Informasi Rekening
  • BCA 777-1200-331 atas nama Fintiawati Nurrahmah
  • Mandiri 131-000-10-96-397 atas nama Fintiawati Nurrahmah
  • Muamalat 116-000-4301 atas nama Dhi Aurrahman
@diorahman
diorahman / convert.md
Last active November 23, 2020 19:16
How to convert ssh-rsa key to loadable botan's X509

So I need to load the X509 key generated from ssh-keygen.

e.g.

$ ssh-keygen -t rsa -b 1024 -C "bla@bla.com"

PUBLIC