Skip to content

Instantly share code, notes, and snippets.

View icasimpan's full-sized avatar

Ismael Casimpan Jr. icasimpan

View GitHub Profile
@icasimpan
icasimpan / pldt-home-fibr-an5506-04-fa-rp2616-advanced-settings.md
Created May 31, 2018 13:03 — forked from kleo/backspace.md
PLDT HOME FIBR AN5506-04-FA RP2616 Advanced Settings

PLDT HOME FIBR AN5506-04-FA RP2616 Advanced Settings

By default the PLDT HOME FIBR AN5506-04-FA RP2616 comes only with limited settings.

Hidden from the web interface are the rest of the router's capabilities and advanced settings.

We just need to enter the right url for the settings you're looking for.

We need to be logged in before we can do anything else, use your defined password if you already set the admin password.

@icasimpan
icasimpan / DIY-siteuptime.sh
Created April 27, 2018 20:47
DIY simple uptime checker via shell
### Credentials file '/home/user/.credentials.txt for additional protection be chmod to 600.
### Sample creds content:
### --user youruser:password_here
### This could then be run from cron every 15mins:
### */15 * * * * /home/user/monitor.sh
###
#!/bin/bash
site_urls="https://www.google.com http://ismael.casimpan.com/"
@icasimpan
icasimpan / drupalgeddon2_CVE-2018-7600_SA-CORE-2018-002.md
Created April 27, 2018 07:27 — forked from g0tmi1k/drupalgeddon2_CVE-2018-7600_SA-CORE-2018-002.md
drupalgeddon2 / SA-CORE-2018-002 / CVE-2018-7600 cURL (PoC)
@icasimpan
icasimpan / https_checker.py
Created April 13, 2018 07:42
Given a text file 'client_domains.txt' check which one are not yet forced to do https
#!/usr/bin/env python3
import subprocess, re
## client_domains.txt format:
## <client_id>:<http_user>:<http_password>:<domain>
##
client_domains='client_domains.txt'
with open(client_domains) as fp:
@icasimpan
icasimpan / db-connect-test.php
Created December 28, 2017 15:26 — forked from chales/db-connect-test.php
Script for a quick PHP MySQL DB connection test.
<?php
# Fill our vars and run on cli
# $ php -f db-connect-test.php
$dbname = 'name';
$dbuser = 'user';
$dbpass = 'pass';
$dbhost = 'host';
$connect = mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'");
@icasimpan
icasimpan / curl_custom_dns.sh
Created December 21, 2017 21:58 — forked from CMCDragonkai/curl_custom_dns.sh
cURL: Selecting a custom DNS server to resolve domain names
#!/usr/bin/env bash
# this can be useful when developing against a custom DNS server, or
# for example, if you made a change to the DNS settings of a domain, and you
# know the authoritative nameserver IP address for a domain, you could use this
# to bypass the intermediate DNS cache, and apply an HTTP request using the new
# DNS settings supplied by your specified (authoritative) nameserver
curl --dns-servers <dns.ip,dns.ip> url.com
curl -s "https://api.ipify.org?format=jsonp&callback=getIP"|cut -d'"' -f4 ## This is used by http://www.showmyipaddress.com/ as of Dec 18, 2017
@icasimpan
icasimpan / pedantically_commented_playbook.yml
Created November 23, 2017 14:41 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@icasimpan
icasimpan / nginx-centos7.yml
Created October 29, 2017 13:54
Sample ansible playbook to install nginx with sample page on CentOS7
## Credits to John Lieske - https://www.ansible.com/blog/getting-started-writing-your-first-playbook
---
- name: Install nginx
hosts: host.name.ip
become: true
tasks:
- name: Add epel-release repo
yum:
name: epel-release
@icasimpan
icasimpan / today_isoweek.go
Last active January 4, 2021 03:29
golang: getting today's week number
package main
import "fmt"
import "time"
func main() {
var time_now time.Time = time.Now() // [ALTERNATIVE] time_now := time.Now()
var _, wk_num = time_now.ISOWeek() // [ALTERNATIVE] _, wk_num := time_now.ISOWeek()
fmt.Println(wk_num)