Skip to content

Instantly share code, notes, and snippets.

Ismael Casimpan icasimpan

Block or report user

Report or block icasimpan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Ansible Let's Encrypt Nginx setup
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
View jenkins-log-parser+verifier.txt
https://wiki.jenkins.io/display/JENKINS/Log+Parser+Plugin
https://www.freeformatter.com/java-regex-tester.html
View apache-long-directory-listing.txt
IndexOptions NameWidth=*
Something like below:
</VirtualHost *:80>
...
...
...
<Directory "/var/www/sites/RELEASES">
Options +Indexes +FollowSymLinks
@icasimpan
icasimpan / keeping-30files.sh
Created Jun 29, 2018
POC shell script for keeping only the last 30 files. Useful for archives.
View keeping-30files.sh
#!/bin/bash
cd /var/backup/files
let count=1
for each_file in $(ls -1t); do
if [ $count -le 30 ]; then
echo "[$each_file] - good"
let count=$count+1
else
@icasimpan
icasimpan / sudo-exec
Created Jun 15, 2018
Running a command as another user without shell
View sudo-exec
sudo su apache -s /bin/bash -c 'touch testing'
View pldt-home-fibr-an5506-04-fa-rp2616-advanced-settings.md

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 Apr 27, 2018
DIY simple uptime checker via shell
View DIY-siteuptime.sh
### 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/"
View drupalgeddon2_CVE-2018-7600_SA-CORE-2018-002.md
@icasimpan
icasimpan / https_checker.py
Created Apr 13, 2018
Given a text file 'client_domains.txt' check which one are not yet forced to do https
View https_checker.py
#!/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 Dec 28, 2017 — forked from chales/db-connect-test.php
Script for a quick PHP MySQL DB connection test.
View db-connect-test.php
<?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'");
You can’t perform that action at this time.