This file contains hidden or 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
-- | |
-- PostgreSQL database dump | |
-- | |
-- Dumped from database version 16.9 (Ubuntu 16.9-0ubuntu0.24.04.1) | |
-- Dumped by pg_dump version 16.9 (Ubuntu 16.9-0ubuntu0.24.04.1) | |
SET statement_timeout = 0; | |
SET lock_timeout = 0; | |
SET idle_in_transaction_session_timeout = 0; |
This file contains hidden or 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_organizations_policy" "plan_1_policy" { | |
name = "dedunu-info-backup-plan-1-policy" | |
type = "BACKUP_POLICY" | |
content = jsonencode(local.plan1) | |
} | |
resource "aws_organizations_policy_attachment" "plan_1_policy_attachment" { | |
policy_id = aws_organizations_policy.plan_1_policy.id | |
target_id = "<account-id>" |
This file contains hidden or 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 |
This file contains hidden or 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> |
This file contains hidden or 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 |
This file contains hidden or 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 | |
""" |
This file contains hidden or 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 virt() { | |
osascript -e "tell application \"Terminal\" to set current settings of front window to settings set \"Ubuntu\"" | |
ssh -Ap 5001 vuser@virtual-server | |
osascript -e "tell application \"Terminal\" to set current settings of front window to settings set \"One Dark\"" | |
} |
This file contains hidden or 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\""' | |
} |
This file contains hidden or 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
LOAD DATABASE | |
FROM mysql://root:Password123@mysqldb.example.com/real_db | |
INTO pgsql://postgres:Password456@pgserver101.example.com/adventure_db | |
WITH include drop, create tables | |
SET search_path to 'public' | |
INCLUDING ONLY TABLE NAMES MATCHING 'user' |
This file contains hidden or 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
LOAD DATABASE | |
FROM mysql://<mysql_user>:<mysql_password>@<mysql_host>/<source_databases> | |
INTO pgsql://<postgres_user>:<postgres_password>@<postgres_host>/<target_database> | |
WITH INCLUDE DROP, CREATE TABLES | |
SET search_path to 'public' | |
INCLUDING ONLY TABLE NAMES MATCHING 'sample_table' |
NewerOlder