Skip to content

Instantly share code, notes, and snippets.

View viseshrp's full-sized avatar
👨‍💻
If it ain't broke, try fixing it.

Visesh Rajendraprasad viseshrp

👨‍💻
If it ain't broke, try fixing it.
View GitHub Profile
@viseshrp
viseshrp / cloudflare_whitelist.sh
Created December 21, 2022 01:26 — forked from Mearman/cloudflare_whitelist.sh
NGINX Cloudflare Access whitelist
#!/bin/bash
cd /mnt/user/appdata/NginxProxyManager/nginx
echo "IPV4" >> new.conf
echo "" >> new.conf
curl -sSL https://www.cloudflare.com/ips-v4 | awk '{print "allow",$1,";"}' >> new.conf
echo "IPV6" >> new.conf
echo "" >> new.conf
curl -sSL https://www.cloudflare.com/ips-v6 | awk '{print "allow",$1,";"}' >> new.conf
@viseshrp
viseshrp / raspberry-pi-plex-server.md
Created December 20, 2022 01:39 — forked from jc-torresp/raspberry-pi-plex-server.md
Setup a Raspberry Pi Plex Media Server (Including external storage media and Windows to Raspbian migration)

Raspberry Pi Plex Server

Installation

Ensure our operating system is entirely up to date:

sudo apt-get update
sudo apt-get upgrade
@viseshrp
viseshrp / README.md
Created October 27, 2022 01:52 — forked from RichardBronosky/README.md
Using cloud-init for cloudless provisioning of Raspberry Pi

Installing cloud-init on a fresh Raspbian Lite image

This is a work in Progress!

Purpose

This mainly demonstrates my goal of preparing a Raspberry Pi to be provisioned prior to its first boot. To do this I have chosen to use the same cloud-init that is the standard for provisioning servers at Amazon EC2, Microsoft Azure, OpenStack, etc.

I found this to be quite challenging because there is little information available for using cloud-init without a cloud. So, this project also servers as a demonstration for anyone on any version of Linux who may want to install from source, and/or use without a cloud. If you fall into that later group, you probably just want to read the code. It's bash so everything I do, you could also do at the command line. (Even the for loop.)

import asyncio
loop = asyncio.get_event_loop()
async def hello():
await asyncio.sleep(3)
print('Hello!')
if __name__ == '__main__':
loop.run_until_complete(hello())
@viseshrp
viseshrp / migrate-django.md
Last active June 24, 2019 15:43 — forked from sirodoht/migrate-django.md
How to migrate Django from SQLite to PostgreSQL

How to migrate Django from SQLite to PostgreSQL

Dump existing data:

python3 .\manage.py dumpdata --indent 2 --natural-primary --natural-foreign -o dump.json

[...........................................................................]

Change settings.py to Postgres backend.

@viseshrp
viseshrp / README.md
Created June 17, 2019 01:13 — forked from ewenchou/README.md
Run Python script as systemd service
  1. Create a service file like dash_sniffer.service
  2. Put it in /lib/systemd/system/
  3. Reload systemd using command: systemctl daemon-reload
  4. Enable auto start using command: systemctl enable dash_sniffer.service