Skip to content

Instantly share code, notes, and snippets.

View TheAshwanik's full-sized avatar
💭
Hi.. Don't hesitate to ping me.. I would love an interesting chat about tech.

Ashwani Kumar TheAshwanik

💭
Hi.. Don't hesitate to ping me.. I would love an interesting chat about tech.
View GitHub Profile
@TheAshwanik
TheAshwanik / rds-aurora-serverless.yml
Last active January 21, 2022 14:46
Getting Started with Amazon RDS Aurora Serverless Data API
View rds-aurora-serverless.yml
AWSTemplateFormatVersion: 2010-09-09
Parameters:
DatabaseName:
Type: String
Description: The RDS Aurora Serverless Database Name
MasterUserName:
Type: String
Description: The RDS Aurora Serverless Master UserName
MasterUserPassword:
Type: String
View deployment-first-crack.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: ghost
labels:
role: blog
spec:
replicas: 1
template:
metadata:
@TheAshwanik
TheAshwanik / WireGuard-site-to-site.md
Created October 8, 2021 09:58 — forked from insdavm/WireGuard-site-to-site.md
Accessing a subnet that is behind a WireGuard client using a site-to-site setup
View WireGuard-site-to-site.md

WireGuard Site-to-Site

Accessing a subnet that is behind a WireGuard client using a site-to-site setup

Problem Summary

We want to access a local subnet remotely, but it is behind a NAT firewall and we can't setup port forwarding. Outgoing connections work, but all incoming connections get DROPPED by the ISP's routing policy.

Solution Summary

@TheAshwanik
TheAshwanik / OSMPackageTranslation
Created September 8, 2021 15:46
OSM Package translation to SOL006
View OSMPackageTranslation
https://opensourcemano.slack.com/archives/CA2TLA48Y/p1631033761066000?thread_ts=1631033639.065400&cid=CA2TLA48Y
A lot of people is trying to use old OSM packages with OSM Rel 9.
It's not possible since the previous information model has been deprecated in favor of SOL006.
Because of that, when you onboard the VNF package with osm vnfd-create, osm vnfpkg-create, or similar commadns, it fails with an error.
Rel Nine was launched without a translator from the old information model to the new information model based on SOL006.
In order to translate the old packages to the new format, you can do the following:
Update OSM client and IM to use the ones from the git repo
@TheAshwanik
TheAshwanik / encode.py
Created October 25, 2020 20:57 — forked from gasman/encode.py
Encoding a file as a Youtube video - https://www.youtube.com/watch?v=hyqLv2_zBdA
View encode.py
# Encode inputfile.tar.gz as a series of video frames
# Frames are written to frames/frameNNNN.png
from PIL import Image
with open('inputfile.tar.gz', 'rb') as f:
data = f.read()
WIDTH = 120
HEIGHT = 90
CHUNK_SIZE = int((WIDTH * HEIGHT) / 8)
@TheAshwanik
TheAshwanik / breachcompilation.txt
Created September 25, 2020 19:36
1.4 billion password breach compilation wordlist
View breachcompilation.txt
wordlist created from original 41G stash via:
grep -rohP '(?<=:).*$' | uniq > breachcompilation.txt
Then, compressed with:
7z a breachcompilation.txt.7z breachcompilation.txt
Size:
@TheAshwanik
TheAshwanik / Delete Project on Glitch
Last active August 7, 2023 00:29
Delete Project on Glitch
View Delete Project on Glitch
While you cannot delete the project itself yet, but you can delete the source code in your project by overwriting the glitch git repository with an empty new commit. This is very important if you just planned to play around but ended up writing important code onto glitch and have a fear of glitch.com getting hacked and your code getting compromised and published on the internet, or if you accidentally commited a private key to glitch and wanted to completely remove it.
on glitch website project edit page open Tools/Extras/Git,Import&Export/Write
Copy_link => is e.g. https://api.glitch.com/git/YOUR-PROJECT-NAME
Copy_user_name => is YOUR-RANDOMLY-GENERATED-GIT-USERNAME e.g. 1aaa1111-1111-aaa1-aa1111111111
on glitch website project edit page open Console(terminal)
git config receive.denyCurrentBranch updateInstead
on your local computer terminal
mkdir foobar
cd foobar
@TheAshwanik
TheAshwanik / Open VPN with LetsEncrypt certificate
Created June 26, 2020 16:56
Open VPN with LetsEncrypt certificate
View Open VPN with LetsEncrypt certificate
https://openvpn.net/vpn-server-resources/managing-settings-for-the-web-services-from-the-command-line/#Installing_a_signed_SSL_certificate
https://certbot.eff.org/docs/using.html
https://serverfault.com/questions/215606/how-do-i-view-the-details-of-a-digital-certificate-cer-file
https://sideras.net/2016/02/24/lets-encrypt-https-certificates-for-openvpn-as-access-server/
https://docs.aws.amazon.com/cli/latest/reference/ec2/authorize-security-group-ingress.html
sudo certbot renew --dry-run ( use --verbose if you want )
sudo service openvpnas start ( or sudo ./sacli start )
sudo service openvpnas stop ( or sudo ./sacli stop )
@TheAshwanik
TheAshwanik / first_run.ini
Created June 26, 2020 16:05 — forked from HighMacGuy/first_run.ini
OpenVPN Access Server Letsencrypt
View first_run.ini
# OpenVPN Let's Encrypt first run config file
#https://loige.co/using-lets-encrypt-and-certbot-to-automate-the-creation-of-certificates-for-openvpn/
cert-name=
authenticator = standalone
standalone-supported-challenges = tls-sni-01
non-interactive = True
rsa-key-size = 4096
email = "user@server.com"
domains = "vpn.server.com"
@TheAshwanik
TheAshwanik / FreeRadius.html
Last active March 11, 2022 13:02
Free radius
View FreeRadius.html
##
Install and configure freeradius to use mariadb database (also for managing freeradius, we install daloRADIUS web interface).
===
1- Install and setup mariadb
To install mariadb, we create mariadb repository file and install required packages. here we install mariadb 10.5:
# vim /etc/yum.repos.d/mariadb.repo
then put the following content in it:
[mariadb]