Skip to content

Instantly share code, notes, and snippets.

@ankitrgadiya
ankitrgadiya / apache.conf
Last active February 13, 2024 07:31
Cgit configurations
# Apache Conf
# Mod cgi required for cgi script
<VirtualHost *:80>
ServerName locahost
# ServerAdmin webmaster@localhost
DocumentRoot "/usr/share/cgit"
<Directory "/usr/lib/cgit/">
@ankitrgadiya
ankitrgadiya / README.md
Last active February 13, 2018 18:15
Nginx configuration for serving from user home directory.

Serving from User's home directory

Permission

$ chmod u=rwx,g=rx,o=rx $HOME
$ chmod u=rwx,g=rx,o=rx $HOME/public_html
$ chmod -R o+r $HOME/public_html
@ankitrgadiya
ankitrgadiya / README.md
Last active June 9, 2018 09:27
Setup self signed Certification Authority using openssl

Setup Certification Authority

First generate Certification Authority key. Entering pasword is recommended.

$ openssl genrsa -des3 -out myCA.key 4096

Change permissions of the key.

@ankitrgadiya
ankitrgadiya / nnpy.ini
Last active July 20, 2018 16:38
nnpy extra files
[uwsgi]
module = nnpy
callable = app
master = true
processes = 5
http = 0.0.0.0:80
@ankitrgadiya
ankitrgadiya / install.sh
Last active July 28, 2018 13:35
Vim Packages Install
#!/bin/bash
mkdir -p ~/.vim/pack/{colorschemes,plugins}/{opt,start}
cd ~/.vim/pack/colorschemes/start/
wget https://github.com/morhetz/gruvbox/archive/master.zip
unzip master.zip
mv gruvbox-master gruvbox
rm master.zip
@ankitrgadiya
ankitrgadiya / README.md
Last active July 31, 2018 08:11
Doch - Docker Helper

Doch

It is a dirty script which basically helps me run and stop pre-defined containers on Euclid. It just uses subprocess in Python to run the commands with the options pre-defined in CONTAINERS dictionary. This script is actually port of docker-func script which I wrote in Bash few months ago for the same thing. The point of this is so that I don't have to remember and type all the options that need to be specified for those containers.

Functions:

names()

names function takes no arguments can returns a list of names of all the running containers. It gets the names from the docker ps command and no third party module is involved in it.

@ankitrgadiya
ankitrgadiya / answers.txt
Created August 13, 2018 05:41
CS50 Pset2 Crack Answers
50fkUxYHbnXGw: rofl
50xcIMJ0y.RXo: YES
50mjprEcqC/ts: CA
50GApilQSG3E2: UPenn
50n0AAUD.pL8g: lloyd
50CcfIk1QrPr6: maybe
509nVI8B9VfuA: TF
50JIIyhDORqMU: nope
50JGnXUgaafgc: ROFL
51u8F0dkeDSbY: NO
#include <stdio.h>
char s[] = {
'\n','}',';',
'\n','i','n','t',' ','m','a','i','n','(','v','o','i','d',')',
'\n','{',
'\n','\t','i','n','t',' ','i',';',
'\n',
'\n','\t','p','r','i','n','t','f','(','\"','#','i','n','c','l','u','d','e',
' ','<','s','t','d','i','o','.','h','>','\\','n','c','h','a','r',' ',
's','[',']',' ','=',' ','{','\\','n','\"',')',';',
@ankitrgadiya
ankitrgadiya / names.py
Created August 31, 2018 08:39
Generate random names
#!/usr/bin/python3
"""
Generate random names
"""
from random import sample
from string import ascii_lowercase
from sys import argv
-----BEGIN CERTIFICATE-----
MIID7DCCAtSgAwIBAgIUH5RFZn99LL9UxiDfD17ZUYIXnfIwDQYJKoZIhvcNAQEL
BQAwgY0xCzAJBgNVBAYTAklOMRIwEAYDVQQIEwlSYWphc3RoYW4xFTATBgNVBAcT
DENoaXR0YXVyZ2FyaDESMBAGA1UEChMJQVJHUEUgSW5jMR4wHAYDVQQLExVDZXJ0
aWZpY2F0ZSBBdXRob3JpdHkxHzAdBgNVBAMTFmFyZ0NBIFJvb3QgQ2VydGlmaWNh
dGUwHhcNMTkwMzMxMTc0MDAwWhcNMjQwMzI5MTc0MDAwWjCBjTELMAkGA1UEBhMC
SU4xEjAQBgNVBAgTCVJhamFzdGhhbjEVMBMGA1UEBxMMQ2hpdHRhdXJnYXJoMRIw
EAYDVQQKEwlBUkdQRSBJbmMxHjAcBgNVBAsTFUNlcnRpZmljYXRlIEF1dGhvcml0
eTEfMB0GA1UEAxMWYXJnQ0EgUm9vdCBDZXJ0aWZpY2F0ZTCCASIwDQYJKoZIhvcN
AQEBBQADggEPADCCAQoCggEBAKP8zrKOI5DL+b3vueMotXFHjh5Yni2sMP17U72y