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
azizultex / Piklist Widget with Group Fields
Last active Feb 7, 2019
Piklist Widget with Group Fields
View Piklist Widget with Group Fields
piklist('field', array(
'type' => 'text'
,'field' => 'title'
,'label' => 'Title'
piklist('field', array(
'type' => 'group'
ashrithr /
Last active Jan 14, 2020
Set up kerberos on Redhat/CentOS 7

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 is the domain name, make a note of the domain name here):

  • Kerberos KDC Server:
  • Kerberos Client:

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

cuth /
Last active Dec 24, 2019
Find the elements that are causing a horizontal scroll. Based on

Debug Horizontal Scroll

(function (d) {
    var w = d.documentElement.offsetWidth,
        t = d.createTreeWalker(d.body, NodeFilter.SHOW_ELEMENT),
    while (t.nextNode()) {
        b = t.currentNode.getBoundingClientRect();
        if (b.right > w || b.left < 0) {
jbinfo /
Last active Nov 6, 2019
How to create a Scrapy CSV Exporter with a custom delimiter and order fields

Create a scrapy exporter on the root of your scrapy project, we suppose the name of your project is my_project, we can name this exporter:

from scrapy.conf import settings
from scrapy.contrib.exporter import CsvItemExporter

class MyProjectCsvItemExporter(CsvItemExporter):

    def __init__(self, *args, **kwargs):
        delimiter = settings.get('CSV_DELIMITER', ',')
#Put in /etc/
#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/" /etc/crontabs/root || echo "0 4 * * 0,3 sh /etc/" >> /etc/crontabs/root
consti / hosts
Last active Feb 23, 2020
/etc/hosts to block shock sites etc.
View hosts
# This hosts file is brought to you by Dan Pollock and can be found at
# You are free to copy and distribute this file for non-commercial uses,
# as long the original URL and attribution is included.
#<localhost> localhost localhost.localdomain broadcasthost
::1 localhost
lrhache /
Last active Feb 23, 2020
Python Selenium - Open new tab / focus tab / close tab

On a recent project, I ran into an issue with Python Selenium webdriver. There's no easy way to open a new tab, grab whatever you need and return to original window opener.

Here's a couple people who ran into the same complication:

So, after many minutes (read about an hour) of searching, I decided to do find a quick solution to this problem.

View my Arch Linux cheat-sheet
Installing Arch:
sudo vim /etc/pacman.conf
Update packages list: sudo pacman -Syy
run sudo pacman -Syu before installing any software (to update the repositories first)
* Timing issue:
- Change hardware clock to use UTC time:
sudo timedatectl set-local-rtc 0
You can’t perform that action at this time.