Skip to content

Instantly share code, notes, and snippets.

OWASP Projects

  • Benchmark
  • my project
  • MyPyApacheFW
  • O-Saft
  • OWASP .NET Project
  • OWASP Academy Portal Project
  • OWASP Androïck Project
  • OWASP Anti-Ransomware Guide Project
@ptantiku
ptantiku / disable_cloud-init_cirros.md
Created October 10, 2017 16:38
disable cloud-init from CirrOS

Disable cloud-init from CirrOS

Problem: when cirros boot, it takes too long to reach the login prompt, because it starts process of cloud-init.

  1. Download cirros from CirrOS 0.3.5
  2. convert .img file (qcow2 format) to .vdi or .vmdk format, using command:
    qemu-image convert -f qcow2 -O vmdk cirros_0.3.5_i386.img cirros_0.3.5_i386.vmdk
  3. Create a new vm in virtualbox/vmware with the .vdi/.vmdk as its harddisk.
@ptantiku
ptantiku / setup_ledger.sh
Last active October 21, 2023 08:35
Setup Ledger Nano S in Linux, with fixing problem on Fedora
#!/bin/bash
# Setup Ledger Nano S in Linux
# according to http://support.ledgerwallet.com/knowledge_base/topics/ledger-wallet-is-not-recognized-on-linux
# However, in Fedora, the "plugdev" group is not existed (obsolete).
# The solution is to replace `GROUP=\"plugdev\"` to `OWNER=\"<username>\"` in the script, for example:
# Original rule: SUBSYSTEMS=="usb", ATTRS{idVendor}=="2c97", ATTRS{idProduct}=="0001", MODE="0660", GROUP="plugdev"
# Change to: SUBSYSTEMS=="usb", ATTRS{idVendor}=="2c97", ATTRS{idProduct}=="0001", MODE="0660", OWNER="ptantiku"
wget -q -O - https://www.ledgerwallet.com/support/add_udev_rules.sh | sed -re 's/GROUP=\\"plugdev\\"/OWNER=\\"'$(whoami)'\\"/' | sudo bash
@ptantiku
ptantiku / fix_openconnect.md
Created August 30, 2017 18:33
Fix openconnect for when connecting to juniper web login, it cannot parse '<input type="username"' as a username field
@ptantiku
ptantiku / csv_to_excel.py
Last active April 13, 2017 08:28
read a csv file (presuming TIS620 encoded) into an excel file
import csv
from openpyxl import Workbook, load_workbook
infile = 'input.csv'
outfile = 'output.xlsx'
# wb = Workbook() # new file
wb = load_workbook( outfile ) # load existing file
ws = wb.active
@ptantiku
ptantiku / docker-compose.yml
Created April 4, 2017 10:51
docker-compose to start python web server
version: '2'
services:
web:
image: python:2.7
volumes:
- $PWD/public_html:/web
ports:
- "443:443"
working_dir: /web
command: bash -c "python -m SimpleHTTPServer 443 2>&1"
@ptantiku
ptantiku / thai.tex
Created January 11, 2017 08:04
Template for using Thai language in Latex
\documentclass[12pt,a4paper]{article}
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\XeTeXlinebreaklocale "th"
\renewcommand{\baselinestretch}{1.2}
\defaultfontfeatures{Scale=1.23}
%\fontspec[Scale=1.23]{TH SarabunPSK} %scale specific font
@ptantiku
ptantiku / install_texlive.sh
Created November 2, 2016 06:40
Install TexLive and TexStudio on Redhat 7.2
#!/bin/bash
yum -y install texlive texlive-latex texlive-xetex
yum -y install texlive-collection-latex
yum -y install texlive-collection-latexrecommended
yum -y install texlive-xetex-def
yum -y install texlive-collection-xetex
#Optional
#yum -y install texlive-collection-latexextra
yum -y install texlive-xltxtra
@ptantiku
ptantiku / install_libthai4r.sh
Created March 25, 2016 21:33
install libthai4r
#!/bin/bash
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y libdatrie-dev libthai-dev
cd /tmp
mkdir libthai4r && curl -L https://github.com/ptantiku/libthai4r/tarball/master | tar xz --strip 1 -C libthai4r
cd libthai4r
ruby extconf.rb
make
sudo make install