Skip to content

Instantly share code, notes, and snippets.

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
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 Sep 25, 2020 — forked from scottlinux/breachcompilation.txt
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 Jul 29, 2020
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 Jun 26, 2020
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 Jun 26, 2020 — 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"
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]
View Rails_Generating_and_Scaffolding.md

Rails Generating & Scaffolding

Rails' use of strict naming conventions means a lot of core code SHOULD be in the same format whoever writes it? It could be written by a friend, colleague or a computer... it shouldn't matter because the same Rails rules apply to everyone.

This means that Rails can actually do some tasks for you! It can actually build things and write code on your behalf...

Coming from another language like PHP, this can seem like magic.

@TheAshwanik
TheAshwanik / domain-to-aws-ec2-instance.md
Created Dec 25, 2019 — forked from keithweaver/domain-to-aws-ec2-instance.md
Point Domain to Amazon Web Services (AWS) EC2 Instance
View domain-to-aws-ec2-instance.md

Point Domain to Amazon Web Services (AWS) EC2 Instance

  1. Open the Amazon Route 53 console at https://console.aws.amazon.com/route53/.
  2. If you are new to Amazon Route 53, you see a welcome page; choose Get Started Now for DNS Management. Otherwise, choose Hosted Zones in the navigation pane.
  3. Choose Create Hosted Zone.
  4. For Domain Name, type your domain name.
  5. Choose Create.
  6. Click the Hosted Zone, edit record set.
  7. In the value, add ec2-54-152-134-146.compute-1.amazonaws.com.
  8. Change your DNS file to point to the IPv4 address (This would be in something like GoDaddy).
View Git Commands
99% of the Git commands you'll need at work, demonstrated in a single script (bitbucket.org)
https://bitbucket.org/BitPusher16/dotfiles/raw/49a01d929dcaebcca68bbb1859b4ac1aea93b073/refs/git/git_examples.sh
https://news.ycombinator.com/item?id=21189256
#!/bin/bash
##########
# contents
@TheAshwanik
TheAshwanik / encrypt_openssl.md
Created Mar 31, 2019 — forked from dreikanter/encrypt_openssl.md
File encryption using OpenSSL
View encrypt_openssl.md

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

You can’t perform that action at this time.