Skip to content

Instantly share code, notes, and snippets.

View LordAmit's full-sized avatar

Amit Seal Ami LordAmit

View GitHub Profile
@LordAmit
LordAmit / imageToGif.sh
Created September 3, 2016 08:06
Convert sequence of image to gif
convert -resize 640 -delay 120 -loop 0 *.JPG animated.gif
@LordAmit
LordAmit / zipPerFolder.sh
Created July 15, 2016 07:09
a simple one line script that makes zips based on folders under a single directory.
for i in */; do zip -r "${i%/}.zip" "$i"; done
# taken from http://stackoverflow.com/a/20452562
@LordAmit
LordAmit / instantfeed.xml
Last active June 8, 2016 09:10
Jekyll Instant Article Facebook RSS Feed
---
layout: null
---
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ site.title | xml_escape }}</title>
<description>{{ site.description | xml_escape }}</description>
<link>{{ site.url }}{{ site.baseurl }}/</link>
#!/bin/bash
####for 64 bit Linux only
sudo apt-get install ia32-libs
sudo apt-get install libc6-i386
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libglu1-mesa:i386
sudo apt-get install libxcursor1 libxcursor-dev
sudo apt-get install libxcursor1:i386
#ssid.conf
<VirtualHost amitssid.com:80>
ServerName amitssid.com
ServerAlias www.amitssid.com
DocumentRoot /var/www/html/SSID/app
ServerAdmin webmaster@localhost
RailsEnv production
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
@LordAmit
LordAmit / NameGenerator.java
Last active April 16, 2022 17:44
A random name generator written in Java. Did it for fun :|
import java.util.Calendar;
import java.util.Random;
/**
* Just did it for fun. :|
*
* @author amit
*
*/
public class NameGenerator {
@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
@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 / 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 / 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