Skip to content

Instantly share code, notes, and snippets.

View tienthanh2509's full-sized avatar

Phạm Tiến Thành tienthanh2509

View GitHub Profile

Contest Management System (like IOI)

Link Website Thi: https://olp.tdmu.edu.vn

Website xem bảng xếp loại trực tuyến https://ranking.olp.d13ht01.tk/

Build tools:

  • gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)
  • g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
@tienthanh2509
tienthanh2509 / 40_custom
Created October 12, 2017 04:25
Grub boot from ISO
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
# hd0 ~ sda
# hd0,1 ~ sda2
# hd0,5 ~ sda6
menuentry "Ubuntu Mini ISO" {
[Unit]
Description=Traefik Proxy
After=network.target
[Service]
Type=forking
Restart=always
User=root
ExecStart=/opt/docker/start_web_proxy.sh &
@tienthanh2509
tienthanh2509 / RabbitMQSSL.java
Last active November 15, 2017 04:56
Test RabbitMQ with validating server certificates
import com.google.gson.JsonObject;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManagerFactory;
import java.io.FileInputStream;
import java.io.InputStream;
import java.net.URI;
@tienthanh2509
tienthanh2509 / rabbitmq_ssl_test.py
Created November 15, 2017 04:07
Test RabbitMQ with validating server certificates
import pika
import urlparse
import ssl
url_str = 'amqps://admin:xxxxxx@localhost//'
channel_id = 'some-rabbitmq-channel'
url = urlparse.urlparse(url_str)
ssl_options = {
echo 'gem: --no-document' >> ~/.gemrc
curl -sL https://deb.nodesource.com/setup_6.x | bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
apt-get update
apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev nodejs yarn
cd
wget --quiet http://ftp.ruby-lang.org/pub/ruby/2.4/ruby-2.4.2.tar.gz
#!/bin/bash
# Build NanoPi NEO firmware from source
export http_proxy=http://10.8.0.1:3128/
export https_proxy=http://10.8.0.1:3128/
export HTTP_PROXY=http://10.8.0.1:3128/
export HTTPS_PROXY=http://10.8.0.1:3128/
export ARCH=arm
export CROSS_COMPILE=arm-linux-
export CROSS_COMPILE=arm-linux-gnueabihf-
@tienthanh2509
tienthanh2509 / install_rabbitmq.sh
Created February 25, 2018 16:19
Install rabbitmq on Ubuntu Core / Server. Support for Armbian, tested on Nanopi neo
#/bin/bash
apt-get install -y wget curl
wget -O- https://packages.erlang-solutions.com/debian/erlang_solutions.asc | apt-key add -
echo "deb http://binaries.erlang-solutions.com/debian stretch contrib" | tee /etc/apt/sources.list.d/erlang-solutions.list
wget -O- https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc | apt-key add -
echo "deb https://dl.bintray.com/rabbitmq/debian stretch main" | tee /etc/apt/sources.list.d/bintray.rabbitmq.list
@tienthanh2509
tienthanh2509 / ubuntu.seed
Created April 26, 2018 05:01
Ubuntu preseed configuration
d-i debian-installer/locale string en_US
d-i time/zone string Europe/Berlin
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string de
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
d-i mirror/country string manual
d-i mirror/http/hostname string lon1.mirrors.digitalocean.com
d-i mirror/http/directory string /ubuntu
@tienthanh2509
tienthanh2509 / install-openvpn-24.sh
Last active September 3, 2024 09:16
Install OpenVPN 2.4.x on Ubuntu 16.04 Xenial
curl -s https://swupdate.openvpn.net/repos/repo-public.gpg | apt-key add -
echo "deb http://build.openvpn.net/debian/openvpn/stable xenial main" > /etc/apt/sources.list.d/openvpn-aptrepo.list
apt update
apt install -y openvpn