Skip to content

Instantly share code, notes, and snippets.

View iRajul's full-sized avatar

Rajul iRajul

  • New Delhi
View GitHub Profile
@johnstanfield
johnstanfield / fail2ban_amznlnx2.sh
Created May 13, 2021 17:59
install fail2ban on amazon linux 2
# run as root or sudo everything below
# install epel
amazon-linux-extras install epel -y
# install fail2ban
yum -y install fail2ban
# configure fail2ban (just adding enabled=true in the sshd section)
cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
@StanGirard
StanGirard / sitemap-crawler.py
Created March 2, 2020 21:33
Sitemap Crawler Python
###################
# You can find the article about this gist here:
# https://primates.dev/find-all-urls-of-a-website-in-a-few-seconds-python/
####################
import requests
from bs4 import BeautifulSoup as Soup
import pandas as pd
import hashlib
@enricosoft
enricosoft / Typescript Tutorial.md
Created May 31, 2017 15:48
Typescript Tutorial

TYPESCRIPT

** What is **

TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. It's developed by Microsoft. Right now the stable version is 2.3. It's used by the major frameworks like React, Angular, NodeJs express, ASP.NET, React Native, etc.

** Installation **

@lightonphiri
lightonphiri / bash-install_google_fonts_on_ubuntu.md
Last active May 15, 2024 15:06
Install Google Fonts on Ubuntu

Install Google Fonts

Download desired fonts

https://fonts.google.com/?selection.family=Open+Sans

Install Google Fonts on Ubuntu

cd /usr/share/fonts
sudo mkdir googlefonts
cd googlefonts
sudo unzip -d . ~/Downloads/Open_Sans.zip

#!/bin/bash
# Anh Nguyen <anh.ng8@gmail.com>
# 2016-04-30
# MIT License
# This script takes in same-size images from a folder and make a crossfade video from the images using ffmpeg.
# Make sure you have ffmpeg installed before running.
# The output command looks something like the below, but for as many images as you have in the folder.
@bennylope
bennylope / ffmpeg-watermark.md
Created April 22, 2016 23:17 — forked from webkader/ffmpeg-watermark.md
FFmpeg add a watermark to video

How to Add a Watermark to Video

FFMPEG filters provide a powerful way to programmatically enhance or alter videos, and it’s fairly simple to add a watermark to a video using the overlay filter. The easiest way to install ffmpeg is to download a pre-built binary for your specific platform. Then you don’t have to worry about including and installing all the right dependencies and codecs you will be using.

Once you have ffmpeg installed, adding a watermark is as easy as passing your existing source through an overlay filter like so:

ffmpeg -i test.mp4 -i watermark.png -filter_complex "overlay=10:10" test1.mp4

Basically, we’re passing in the original video, and an overlay image as inputs, then passing it through the filter, and saving the output as test1.mp4.

@riyazMuhammad
riyazMuhammad / CustomItemClickListener.java
Last active December 30, 2020 15:10
Easy Implementation of RecyclerView custom onItemClickListener
public interface CustomItemClickListener {
public void onItemClick(View v, int position);
}
@zloynemec
zloynemec / adminer_setup.sh
Created April 15, 2015 12:29
Secure adminer nginx setup
# Secure adminer setup
# Author Taras Kozlov
# download adminer to separate directory
mkdir -p /var/www/admin
cd /var/www/admin
wget http://www.adminer.org/latest.php -O adminer.php
echo '<?php phpinfo(); >' > info.php
sudo -i
@jareware
jareware / s3-curl-backups.md
Last active May 11, 2024 23:39
Simple, semi-anonymous backups with S3 and curl

⇐ back to the gist-blog at jrw.fi

Simple, semi-anonymous backups with S3 and curl

Backing stuff up is a bit of a hassle, to set up and to maintain. While full-blown backup suites such as duplicity or CrashPlan will do all kinds of clever things for you (and I'd recommend either for more complex setups), sometimes you just want to put that daily database dump somewhere off-site and be done with it. This is what I've done, with an Amazon S3 bucket and curl. Hold onto your hats, there's some Bucket Policy acrobatics ahead.

There's also a tl;dr at the very end if you just want the delicious copy-pasta.

Bucket setup

@paulakreuger
paulakreuger / angular-filters.js
Last active October 18, 2023 19:34
Capitalize First Letter Filter - AngularJS
app.filter('capitalize', function() {
return function(input, scope) {
if (input!=null)
input = input.toLowerCase();
return input.substring(0,1).toUpperCase()+input.substring(1);
}
});