Skip to content

Instantly share code, notes, and snippets.

View ibnesayeed's full-sized avatar

Sawood Alam ibnesayeed

View GitHub Profile
@ibnesayeed
ibnesayeed / userContent.css
Created September 8, 2011 21:38
Custom User CSS for Firefox to display Urdu in Nastaleeq fonts or other suitable typefaces in Google Plus.
@-moz-document domain(plus.google.com) {
div[dir="rtl"], span[dir="rtl"].zj {
font-family: 'Jameel Noori Nastaleeq','Alvi Nastaleeq','Pak Nastaleeq','Nafees Web Naskh','Urdu Naskh Asiatype',Tahoma,'Lucida Grande',Verdana,Arial,Sans-Serif;
font-size: 130%;
}
}
@ibnesayeed
ibnesayeed / randomlines.py
Created May 26, 2021 18:45
Stream random lines from a file
#!/usr/bin/env python3
import sys
from random import randrange
class RandomLines():
def __init__(self, fname):
self._fname = fname
@ibnesayeed
ibnesayeed / Dockerfile
Created July 20, 2017 14:53
Dockerize Your Projects: An example to illustrate basic Dockerization
FROM python
LABEL maintainer="Sawood Alam <@ibnesayeed>"
RUN pip install beautifulsoup4
RUN pip install requests
COPY main.py /app/
WORKDIR /app
RUN chmod a+x main.py
ENTRYPOINT ["./main.py"]
@ibnesayeed
ibnesayeed / sighup.go
Created June 3, 2016 15:18 — forked from andelf/sighup.go
golang process SIGHUP, HUP signal to reload configuration
// program
package main
import "os/signal"
import "os"
import "fmt"
import "syscall"
import "time"
@ibnesayeed
ibnesayeed / ipwb-cov-report.md
Created August 26, 2020 16:32
IPWB Test Coverage Report
/tmp/ipwb$ coverage run -m pytest
=================================== test session starts ===================================
platform linux -- Python 3.8.2, pytest-6.0.1, py-1.9.0, pluggy-0.13.1
rootdir: /tmp/ipwb, configfile: setup.cfg
plugins: flake8-1.0.6, cov-2.10.1
collected 121 items                                                                                

tests/test_backends.py .....                                                        [  4%]
tests/test_compile_target_uri.py ..                                                 [  5%]
@ibnesayeed
ibnesayeed / README.md
Last active May 1, 2020 22:47
Mount your remote machine's home directory locally over SSHFS

SSHFS Remote Home Mounter

Download the script, make it executable, and run:

$ chmod a+x remotehomemount.sh
$ ./remotehomemount.sh [<REMOTEID> [<MNTDIR> [<REMOTEHOST>]]]
@ibnesayeed
ibnesayeed / README.md
Last active March 26, 2020 04:36
PyWB Memento Compliance Audit Data

PyWB Memento Compliance Audit Data

Test data file pywbtest.tar.gz has the following directory structure:

$ tree pywbtest
├── collections
│   └── example
│       ├── archive
│ │ ├── example-20200323133704.warc.gz
$ ls
Dockerfile  linkextractor.py
$ cat linkextractor.py
#!/usr/bin/env python

import sys
@ibnesayeed
ibnesayeed / twitter-cache-headers-curl.bash
Created March 20, 2018 17:40
Twitter tried hard to prevent caching
$ curl -i --silent -H "Accept-Language: ur" https://twitter.com/ | more
HTTP/1.1 200 OK
cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
content-length: 130455
content-type: text/html;charset=utf-8
date: Tue, 20 Mar 2018 17:35:31 GMT
expires: Tue, 31 Mar 1981 05:00:00 GMT
last-modified: Tue, 20 Mar 2018 17:35:31 GMT
pragma: no-cache
server: tsa_b
@ibnesayeed
ibnesayeed / twitter-timemap-lang-downloader.sh
Last active April 17, 2019 21:39
A Shell script to download TimeMaps of a Twitter handle in various language variants using MemGator
#!/usr/bin/env bash
# A script to download TimeMaps of a Twitter handle in various language variants.
#
# ./twitter-timemap-lang-downloader.sh <TwitterHandle> [<OutputDir>]
#
# Author: Sawood Alam <@ibnesayeed>
if [ $# -eq 0 ]
then