View .gitignore Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################## | |
## Java | |
############################## | |
.mtj.tmp/ | |
*.class | |
*.jar | |
*.war | |
*.ear | |
*.nar | |
hs_err_pid* |
View Multi-node-Vagrantfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure("2") do |config| | |
config.vm.define "master" do |master| | |
master.vm.box = "ubuntu/trusty64" | |
master.vm.hostname = "master.local" | |
master.vm.network "private_network", ip: "192.168.2.2" | |
end | |
config.vm.define "slave1" do |slave1| | |
slave1.vm.box = "ubuntu/trusty64" | |
slave1.vm.network :private_network, ip: "192.168.2.3" |
View create_privatebin.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This script creates a PrivateBin using Python 3. | |
Code is based on https://github.com/r4sas/PBinCLI repository. | |
Thanks a lot @r4sas! | |
Below modules should be installed in the environment. | |
requests | |
base58 | |
pycryptodome | |
""" |
View aws_rds_unused_lambda_function.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""RDS-Unused AWS Lambda Function | |
It will go through the REGION's RDS instances and check on CloudWatch for the unused | |
instances and will stop them. | |
""" | |
import json | |
from datetime import datetime, timedelta | |
from multiprocessing import Process, Pipe | |
import boto3 |
View grep_test.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
printf 'a\na\nb\nc\nd\nd' > file1 | |
printf 'b\nd' > file2 | |
echo 'Test Case 1, without sort command:' | |
grep -F -f file2 -v file1 | uniq | |
echo 'Test Case 1, with sort command:' | |
grep -F -f file2 -v file1 | sort |uniq |
View remove_all_followers.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tweepy | |
__author__ = 'dedunumax' | |
''' | |
This script will remove all the followers from your twitter account. For that first it will block user one by one and | |
then unblock them. If you are following your followers, you won't be subscribed to them anymore once you run this job. | |
Rub this script carefully. | |
Install tweepy module using pip. To install tweepy run below command in your terminal. |
View redis-insert.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat data.csv | awk -F',' '{print " SET \""$1"\" \""$2 "\"\n"}'| /opt/redis-2.8.17/src/redis-cli --pipe |
View RDS.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_db_instance" "mydb" { | |
engine = "mysql" | |
engine_version = "5.6.40" | |
instance_class = "db.t1.micro" | |
name = "initial_db" | |
username = "example" | |
password = "1234" | |
allocated_storage = "20" | |
publicly_accessible = "true" | |
} |
View blogger-theme.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" ?> | |
<!DOCTYPE html> | |
<html b:version='2' class='v2' expr:dir='data:blog.languageDirection' expr:lang='data:blog.locale' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'> | |
<head> | |
<meta content='width=device-width, initial-scale=1.0' name='viewport'/> | |
<meta content='A travel blog.' name='description'/> | |
<b:include data='blog' name='all-head-content'/> | |
<link href='{{ site.baseurl }}/favicon.png' rel='shortcut icon'/> | |
<link href='https://cdn.rawgit.com/dreampulse/computer-modern-web-font/master/fonts.css' rel='stylesheet' type='text/css'/> | |
<title>travel - Dedunu Dhananjaya</title> |
View production_bridge.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function prod() { | |
ssh -A luser@laptop -C 'osascript -e "tell application \"Terminal\" to set current settings of front window to settings set \"Red Alert\""' | |
ssh -A buser@bridge.company.org | |
ssh -A luser@laptop -C 'osascript -e "tell application \"Terminal\" to set current settings of front window to settings set \"Ubuntu\""' | |
} |
NewerOlder