Skip to content

Instantly share code, notes, and snippets.

View VMuliadi's full-sized avatar

Vinsen Muliadi VMuliadi

View GitHub Profile
<?php
// define the mysql settings
define("DB_SERVER", "localhost");
define("DB_USERNAME","username");
define("DB_PASSWORD", "password");
define("DB_NAME", "database");
// setting MySQL table and configuration
$connection = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME) or die ("Cannot connect");
package distance_measurement;
/*==================================
---- https://github.com/MaX121/ ----
admin [at] max [dash] metal [dot] us
==================================*/
import java.util.ArrayList;
import java.util.HashMap;
@VMuliadi
VMuliadi / [Python] jQuery + Bootstrap Latest Generator.py
Last active July 13, 2016 22:50
A simple application that can automatically generate Bootstrap CSS, Bootstrap JS, and jQuery on a single HTML file. Launch this application and ready to go
import sys
import urllib2
from bs4 import BeautifulSoup
# CSS and JS for Bootstrap
url = "https://www.bootstrapcdn.com/"
page = urllib2.urlopen(url)
bsoup = BeautifulSoup(page, 'lxml')
js_link = bsoup.find('input', {'id': 'quickstartjs_form'}).get('value')
css_link = bsoup.find('input', {'id': 'quickstartcss_form'}).get('value')
@VMuliadi
VMuliadi / [Python] install.py
Last active August 25, 2018 17:27
An automation script that will handle the full package on my laptop. Using Python 2.7 and Web Scraping technique to get the latest version. Make sure you already installed Python 2
import os
os.system('dnf update -y')
os.system('dnf install -y pip python2-lxml')
os.system('pip install pip --upgrade')
os.system('pip install BeautifulSoup4 lxml')
import urllib2
import subprocess
from bs4 import BeautifulSoup
@VMuliadi
VMuliadi / [TXT] Bootable Windows - Linux.txt
Last active July 22, 2016 14:44
Create a bootable Windows USB from GNU/Linux distribution. This gist only contain step by step to do it
gparted >>> format flash drive to FAT32
gparted >>> add "boot" flag to the drive
grub2 >>> sudo grub2-install /dev/sd[x] --boot-directory="/run/media/[user]/[flash_disk_name]"
nano >>> nano /boot/grub2/grub.cfg
nano >>> add these script
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
menuentry 'Install Windows [y]' {
ntldr /bootmgr
@VMuliadi
VMuliadi / [Sublime Text] Settings - User
Last active July 28, 2016 12:40
My configuration on Sublime Text 3
{
"bold_folder_labels": true,
"color_scheme": "Packages/Agila Theme/Agila Origin Oceanic Next.tmTheme",
"fade_fold_buttons": false,
"font_family": "Source Code Pro",
"font_size": 14,
"ignored_packages":
[
"Vintage"
],
@VMuliadi
VMuliadi / login.py
Last active June 29, 2017 09:22
Command Line version to logged in/out into Sanata Dharma University internet access
import requests, sys, getpass, urllib2
from bs4 import BeautifulSoup
from lxml import html
username = sys.argv[1]
base_url = 'http://logout.usd/login'
result = requests.request('GET', base_url)
if str(result.status_code) == '200': # check connectivity
password = getpass.getpass('Password for %s : ' % username)
logging_in = requests.post(base_url, data={'username': username, 'password': password})
html_tags = html.fromstring(logging_in.content)
@VMuliadi
VMuliadi / allitebooks.py
Last active March 16, 2017 13:43
Bulk downloader from allitebooks.com - Use wisely
import re, wget, urllib2, sys
from bs4 import BeautifulSoup
booklist = []
base_url = 'http://www.allitebooks.com/'
for index, book_title in enumerate(sys.argv) :
if index > 0 : booklist.append(book_title)
for index, booktitle in enumerate(booklist, 1) :
@VMuliadi
VMuliadi / tcp.sh
Last active April 19, 2017 03:28
Network analyzer to capture username and password for internet login in Sanata Dharma University
sudo tcpdump -i any -w "tcpdump_$(date '+%d%m%Y').pcapng" -c 100 2> /dev/null # command
@reboot tcpdump -i any -w "tcpdump_$(date '+%d%m%Y').pcapng" -c 100 2> /dev/null # crontab
@VMuliadi
VMuliadi / auto-sshub.py
Last active July 10, 2018 08:12
SofwareSeni Hub Login from Command Line Application. Based on Python and NodeJS (PhantomJS)
# /usr/bin/python
import os
import sys
import base64
import getpass
import requests
from lxml import html
from selenium import webdriver
from prettytable import PrettyTable