Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View rohithreddy's full-sized avatar
🐢
working from dreams

Rohith rohithreddy

🐢
working from dreams
View GitHub Profile
@rohithreddy
rohithreddy / list.py
Created January 25, 2022 09:22 — forked from fellu/list.py
Auto-list NFTs on OpenSea with Browser Automation
# First install Chrome, and the Selenium driver
# Next, download and save the MetaMask CRX (there are plenty of guides on how to do this)
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import time
@rohithreddy
rohithreddy / clone_all.sh
Created June 15, 2021 16:44
Clone all repos in a github org
curl -s "https://api.github.com/users/ORG/repos?per_page=100" | jq -r ".[].git_url" | xargs -L1 git clone
@rohithreddy
rohithreddy / main.py
Created May 29, 2021 22:38 — forked from ohaz/main.py
Parse math formulas in python and put parentheses around Mult/Div
from __future__ import print_function
import ast
def recurse(node):
if isinstance(node, ast.BinOp):
if isinstance(node.op, ast.Mult) or isinstance(node.op, ast.Div):
print('(', end='')
recurse(node.left)
recurse(node.op)
@rohithreddy
rohithreddy / Create unencrypted CRT and KEY from PFX.MD
Created September 24, 2020 19:15 — forked from datvm/Create unencrypted CRT and KEY from PFX.MD
Create (no password/unencrypted) CRT and KEY certificates from PFX

Sometimes you may need an unencrypted pair for your certificate (in my case, I need it for Docker Registry).

You can use OpenSSL to generate one. You will need:

  • OpenSSL (if you use Windows, you can get OpenSSL for Windows)
  • A certificate in PFX format inputfile.pfx (you can convert from other formats using OpenSSL too). You will of course need its password. It is useless if you do not have it, just throw that file away.

Create (encrypted) key file:

First, you need to create a key file using the following command:

@rohithreddy
rohithreddy / kernel_upgrade.sh
Created November 8, 2019 20:22
Gentoo Kernel upgrade / build
eselect kernel list
eselect kernel set #
# Use current kernel config and store copy
gunzip /proc/config.gz -c > /root/config; cp /root/config /root/config-$(uname -r)
# Optionally change module settings in the config file, or use --menuconfig
# with genkernel.
genkernel --makeopts=-j9 --splash --kernel-config=/root/config all
@rohithreddy
rohithreddy / xmonad.hs
Created April 4, 2019 22:59 — forked from tylevad/xmonad.hs
XMonad window manager config
{-# LANGUAGE TypeSynonymInstances, DeriveDataTypeable, MultiParamTypeClasses, NoMonomorphismRestriction #-}
-- Ty Levad - tylevad@gmail.com
-- xmonad.hs
-- Core Modules
import System.Exit
import XMonad hiding ((|||))
import qualified XMonad.StackSet as W
-- Action Modules
@rohithreddy
rohithreddy / nginx_sites_enabled_local_proxy
Created March 17, 2019 21:06
conf file for running Nginx as reverse proxy
server { # simple load balancing
listen 80;
location / {
proxy_pass http://localhost:3000;
}
}
@rohithreddy
rohithreddy / metabase.conf
Created March 17, 2019 21:05
Supervisord running an example / metabase app
[program:metabasetest]
autostart = true
autorestart = true
command = /usr/bin/java -jar /home/rohith/metabase.jar
startretries = 3
user = rohith
directory = /home/rohith/
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Exception.Base
import Control.Monad
import Control.Monad.IO.Class
import Control.Monad.Trans.Class
import Control.Monad.Trans.Reader
import qualified Data.ByteString.Char8 as BS
@rohithreddy
rohithreddy / AvroDeserializationSchema.java
Created March 11, 2018 11:45
Avro deserializer for Flink's Data Stream API Kafka Source
import org.apache.avro.io.BinaryDecoder;
import org.apache.avro.io.DatumReader;
import org.apache.avro.io.DecoderFactory;
import org.apache.avro.reflect.ReflectDatumReader;
import org.apache.avro.specific.SpecificDatumReader;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.java.typeutils.TypeExtractor;
public class AvroDeserializationSchema<T> implements DeserializationSchema<T> {