Skip to content

Instantly share code, notes, and snippets.

View LordAmit's full-sized avatar

Amit Seal Ami LordAmit

View GitHub Profile
@LordAmit
LordAmit / QueryExecutor.cs
Created September 25, 2011 19:46
Class QueryExecutor is in charge of queries.
class QueryExecutor {
string strQuery;
CreateConnection c;
public QueryExecutor(string query) {
strQuery = query;
c = new CreateConnection();
}
public QueryExecutor(string query, string strConnection) {
strQuery = query;
\documentclass{beamer}
%এটা লাগবে,
\usepackage{fontspec}
%এটা দিয়ে একটা ফন্ট ডিফাইন করা হয়েছে, এইটা দিয়ে আমরা বাংলা লেখাগুলার আগে লিখে দিলে ঐ অংশ বাংলা ফন্ট দিয়ে পড়বে
\font\deffont="FreeSerif:script=beng" at 14pt
%যেমন এখানে
\title{\deffont একটি বাংলা লেখা}
\author{\deffont অমিত}
\date{\deffont ৭ জানুয়ারি, ২০১৩}
\begin{document}
\documentclass{article}
%এই প্যাকেজটা লাগবে
\usepackage{fontspec}
%script অংশ দিয়ে বুঝাচ্ছি এটা বাংলা
\setmainfont{SolaimanLipi:script=beng}
%প্যারাগ্রাফের শুরুতে ফাঁকা যায়গা থাকবে না
\setlength{\parindent}{0in}
\title{একটি বাংলা লেখা}
\author{অমিত}
\date{১৬ জানুয়ারি, ২০১৩}
@LordAmit
LordAmit / buffer1.c
Last active October 28, 2022 11:24
Buffer Overflow / Stack Smashing Example
/*
Written by Amit Seal Ami
*/
#include <stdio.h>
#include <string.h>
/*
Instructions
============
@LordAmit
LordAmit / data_structure.py
Created July 5, 2013 13:13
Linked List, Stack, Queue implementations in Python. Might be wrong somewhere due to my lack of skill in Python. Please leave a comment in case you notice anything I should fix.
# -*- coding: utf-8 -*-
#!/usr/bin/python
from cssutils.util import Item
#==============================================================================
# Written following the example by Graham.
# IMHO, there was problem with the stack pop method. Even though
# tail pointed to the previous object in the linked list right after pop,
# the tail kept pointing at the popped Item.
#Written by Amit
@LordAmit
LordAmit / makefile
Created July 6, 2013 14:12
My first make file that worked as I wanted. Will use this for future references.
CC = gcc
CFLAGS = -lm
all: mm1
backup:
cd .. && zip chap1_c_backup.zip chap1_c/*
mm1: lcgrand.o mm1.o
@echo making everything nice and sweet to mm1
@LordAmit
LordAmit / pdfmerge.sh
Created July 12, 2013 16:55
Bash script for merging PDF in alphabetical order using pdftk in terminal
#!/bin/bash
pdftk *.pdf cat output output.pdf
@LordAmit
LordAmit / install_zip.sh
Last active April 26, 2016 04:29
install.sh of Brightness Controller
#!/bin/sh
# Install Brightness Controller script
# Download / Save this script. Make it executable. Run it.
# It requires having wget installed, if you use another command line interface downloader, change wget to it.
wget https://github.com/lordamit/Brightness/archive/master.zip
unzip -o master.zip -d ~/.Brightness
rm master.zip
echo "[Desktop Entry]
Encoding=UTF-8
@LordAmit
LordAmit / convert_jpgs_pdf.py
Last active December 21, 2015 14:39
script to convert sets of jpgs into a single, compact pdf. Works well enough for me. might need some tweaking.
import subprocess
cmd_list_jpg = 'ls -C -1 | grep .jpg'
all_files = subprocess.check_output(cmd_list_jpg, shell = True)
for i in all_files.split('\n'):
if i.find('convert') != -1:
continue
subprocess.check_output('convert {0} {0}.pdf'.format(i), shell = True)
@LordAmit
LordAmit / port_forward.sh
Created January 1, 2014 15:59
Urban terror server port forwarding
#!/bin/bash
#<- this is a comment.
newport=2222
forwardport=27960
sudo iptables -t nat -A PREROUTING -p udp --dport $newport -j REDIRECT --to-ports $forwardport
#To check whether this rule works, type this command
#sudo iptables -nL -v --line-numbers -t nat