Skip to content

Instantly share code, notes, and snippets.

View sakti's full-sized avatar
🦀

Sakti Dwi Cahyono sakti

🦀
View GitHub Profile
@sakti
sakti / sudoku.pas
Created January 17, 2011 22:06
sudoku game in pascal
program sudoku;
uses crt,dos;
type
puzzle=array[0..80]of integer;
arraysol=array[0..2]of puzzle;
waktu=record
jam,menit,detik,sec:word;
end;
const
database:arraysol=(
@sakti
sakti / SimpleSecureHTTPServer.py
Created December 21, 2010 11:24
simple secure http server using python
'''
SimpleSecureHTTPServer.py - simple HTTP server supporting SSL.
- replace fpem with the location of your .pem server file.
- the default port is 443.
usage: python SimpleSecureHTTPServer.py
Credit: https://code.activestate.com/recipes/442473-simple-http-server-supporting-ssl-secure-communica/
License: PSF License
@sakti
sakti / stream xserver
Created February 19, 2013 13:15
streaming screen capture on x server using gstreamer
gst-launch-0.10 ximagesrc use-damage=0 ! video/x-raw-rgb,framerate=15/1 ! ffmpegcolorspace ! video/x-raw-yuv ! jpegenc ! multipartmux ! tcpserversink host=0.0.0.0 port=11111
@sakti
sakti / up.php
Created December 21, 2010 23:25
<html>
<form enctype="multipart/form-data" action="ps.php" method="POST">
<!-- MAX_FILE_SIZE must precede the file input field -->
<input type="hidden" name="MAX_FILE_SIZE" value="9000000" />
<!-- Name of input element determines name in $_FILES array -->
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>
</html>
@sakti
sakti / INSTALL.rst
Last active March 29, 2020 18:21 — forked from jensens/INSTALL.rst
sentry setup with docker-compose

In order to run this image do: docker-compose up -d to get all up. On first run DB initialization and initial user setup is done like so:

First start a bash in the container: docker-compose exec sentry /bin/bash. Then, inside bash, do sentry upgrade wait until it asks you for an inital user. When finished exit the bash.

When in doubt check with docker-compose ps if all went fine.

@sakti
sakti / keybase.md
Last active November 5, 2019 04:40

Keybase proof

I hereby claim:

  • I am sakti on github.
  • I am sakti (https://keybase.io/sakti) on keybase.
  • I have a public key ASC-LqJyXpkkHllCUASgevtxmlyseW8BllNGUa7pKY9Fzwo

To claim this, I am signing this object:

@sakti
sakti / parse_toc.py
Created April 2, 2012 03:27
Extract TOC information from pdf file using pdfminer
#!/usr/bin/env python
# parse_toc.py
from pdfminer.pdfparser import PDFParser, PDFDocument
def parse(filename, maxlevel):
fp = open(filename, 'rb')
parser = PDFParser(fp)
doc = PDFDocument()
parser.set_document(doc)
@sakti
sakti / generate.php
Created December 21, 2010 11:17
generate rsa key
<pre>
<?php
echo "<h2>Membuat public & private key RSA</h2>\n";
//untuk membuat kunci yang lebih panjang coba gmp_random
//$rand1 = gmp_random(1); // mengeluarkan random number dari 0 sampai 1 x limb
//$rand2 = gmp_random(1); // mengeluarkan random number dari 0 sampai 1 x limb
//mencari bilangan random
package main
import (
"bufio"
"fmt"
"os"
"runtime/debug"
"time"
"github.com/allegro/bigcache"
#include <stdio.h>
#include <termios.h>
#include <unistd.h>
int getch( ) {
struct termios oldt, newt;
int ch;
tcgetattr( STDIN_FILENO, &oldt );
newt = oldt;
newt.c_lflag &= ~( ICANON | ECHO );