Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing on playing ;)

Kamrul Ahsan k4mrul

🎯
Focusing on playing ;)
Block or report user

Report or block k4mrul

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
@k4mrul
k4mrul / ssl-in-wget.sh
Created Jul 29, 2019
Allow ssl in openwrt router
View ssl-in-wget.sh
#!/bin/sh
# Information from openwrt.org wiki:
# https://wiki.openwrt.org/doc/howto/wget-ssl-certs
#
# Script written by oct8l (www.oct8l.com)
#
# Script licensed as CC BY-NC-SA 3.0
# (https://creativecommons.org/licenses/by-nc-sa/3.0)
@k4mrul
k4mrul / kerberos_setup.md
Created Dec 14, 2018 — forked from ashrithr/kerberos_setup.md
Set up kerberos on Redhat/CentOS 7
View kerberos_setup.md

Installing Kerberos on Redhat 7

This installation is going to require 2 servers one acts as kerberos KDC server and the other machine is going to be client. Lets assume the FQDN's are (here cw.com is the domain name, make a note of the domain name here):

  • Kerberos KDC Server: kdc.cw.com
  • Kerberos Client: kclient.cw.com

Important: Make sure that both systems have their hostnames properly set and both systems have the hostnames and IP addresses of both systems in

View Wordpress Nginx Config
##################################
# WORDPRESS NGINX CONFIGURATIONS
##################################
# /etc/nginx/wordpress.conf
#
# Contains a common configuration for use by nginx on a WordPress
# installation. This file should be included in any WordPress site
# nginx virtual host config located in sites-available with the following line:
#
# include /etc/nginx/wordpress.config;
View adblock.sh
#!/bin/sh
#Put in /etc/adblock.sh
#Script to grab and sort a list of adservers and malware
#Check proper DHCP config and, if necessary, update it
uci get dhcp.@dnsmasq[0].addnhosts > /dev/null 2>&1 || uci add_list dhcp.@dnsmasq[0].addnhosts=/etc/block.hosts && uci commit
#Leave crontab alone, or add to it
grep -q "/etc/adblock.sh" /etc/crontabs/root || echo "0 4 * * 0,3 sh /etc/adblock.sh" >> /etc/crontabs/root
@k4mrul
k4mrul / gist:89249098af10dbfcfe1aafc86b000eda
Created Mar 29, 2018 — forked from aioutecism/gist:2638bb9eaf9ffc13348c
Set up a VPN Server (PPTP) on AWS and use it anywhere
View gist:89249098af10dbfcfe1aafc86b000eda

Set up a VPN Server (PPTP) on AWS

  1. Create a EC2 instance using Ubuntu 14.04.
  2. In Secure Group Inbound Rules, add a SSH Rule(TCP, Port 22, 0.0.0.0/0) and a Custom TCP Rule(TCP, Port 1723, 0.0.0.0/0).
  3. Optional: Associate a Elastic IP with the instance.
  4. SSH into the instance.
  5. sudo apt-get install pptpd.
  6. sudo vim /etc/pptpd.conf. Uncomment localip 192.168.0.1 and remoteip 192.168.0.234-238,192.168.0.245.
  7. sudo vim /etc/ppp/pptpd-options. Uncomment ms-dns and ms-wins. Change the IP to Google's DNS like this:
@k4mrul
k4mrul / regex.md
Created Dec 23, 2016 — forked from jacurtis/regex.md
Most Useful Regex's
View regex.md

#Useful Regular Expressions

These are the most useful Regular Expressions that I find myself using on a regular basis


URLs

Test to see if a string is a valid website address or not.

All URLs
View wordpress-image-crop.php
<?php
// in functions.php
add_theme_support( 'post-thumbnails');
/*
Wordpress crop an image = 5 size. Sizes are given below
thumbnail // Thumbnail (default 150px x 150px max)
@k4mrul
k4mrul / 0_reuse_code.js
Created Aug 24, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.