Skip to content

Instantly share code, notes, and snippets.

View secunit64's full-sized avatar

Madhu Srinivasan secunit64

View GitHub Profile
@secunit64
secunit64 / cool-game-programming-blogs.opml
Created January 28, 2018 06:25 — forked from Reedbeta/cool-game-programming-blogs.opml
List of cool blogs on game programming, graphics, theoretical physics, and other random stuff
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Graphics, Games, Programming, and Physics Blogs</title>
</head>
<body>
<outline text="Tech News" title="Tech News">
<outline type="rss" text="Ars Technica" title="Ars Technica" xmlUrl="http://feeds.arstechnica.com/arstechnica/index/" htmlUrl="https://arstechnica.com"/>
<outline type="rss" text="Polygon - Full" title="Polygon - Full" xmlUrl="http://www.polygon.com/rss/index.xml" htmlUrl="https://www.polygon.com/"/>
<outline type="rss" text="Road to VR" title="Road to VR" xmlUrl="http://www.roadtovr.com/feed" htmlUrl="https://www.roadtovr.com"/>
@secunit64
secunit64 / gist:e3a5b258d59bea48d367335a556e000c
Created October 9, 2019 16:30
Removing a git submodule
> git submodule deinit <path_to_submodule>
> git rm <path_to_submodule>
> git commit-m "Removed submodule "
> rm -rf .git/modules/<path_to_submodule>
@secunit64
secunit64 / multiple_ssh_setting.md
Created November 15, 2019 22:59 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@secunit64
secunit64 / lsb_release
Created March 20, 2020 18:21 — forked from skx/lsb_release
Simple alternative to /usr/bin/lsb_release
#!/bin/sh
#
# This is a simple alternative to /usr/bin/lsb_release which
# doesn't require python.
#
# If /etc/os-release exists then we use that to output data
# in a compatible format to the original lsb_release utility.
#
# I consider this script trivial enough to be in the public-domain,
# but any patches or suggestsions will be welcome.
@secunit64
secunit64 / tornadosse.py
Created April 17, 2020 19:07 — forked from mivade/tornadosse.py
Tornado server-sent events
"""Demonstration of server-sent events with Tornado. To see the
stream, you can either point your browser to ``http://localhost:8080``
or use ``curl`` like so::
$ curl http://localhost:8080/events
"""
import signal
from tornado import web, gen

Performance of Flask, Tornado, GEvent, and their combinations

Wensheng Wang, 10/1/11

Source: http://blog.wensheng.org/2011/10/performance-of-flask-tornado-gevent-and.html

When choosing a web framework, I pretty much have eyes set on Tornado. But I heard good things about Flask and Gevent. So I tested the performance of each and combinations of the three. I chose something just a little more advanced than a "Hello World" program to write - one that use templates. Here are the codes:

1, Pure Flask (pure_flask.py)

Search for a string within files in the current directory

grep -wrin "search for this text" .

Find subdirectories matching a pattern

find /your/directory -name "pattern*"
@secunit64
secunit64 / slurm.md
Last active March 21, 2021 20:53
Useful Commands in SLURM

Description of nodes, cores and memory

sinfo -o "%n,%N,%o,%X,%Y,%Z,%c,%m"
sinfo -o "%10n %10N %10o %10X %10Y %10Z %10c %10m %25f %10G"

Exclude a specific node

@secunit64
secunit64 / ssh.md
Last active January 5, 2021 01:36
Tips and Tricks with SSH

Setting up a reverse SSH Tunnel

ssh -N -R 2210:localhost:22 username@host.com

This command can be interpreted as, create a tunnel between the remote host's port 2210 and localhost:22, where the remote host is host.com.

-R implies that the tunnel will be used from the remote side - i.e. host.com.

This command will initiate an ssh connection with reverse port forwarding option

@secunit64
secunit64 / asyncio.py
Created July 27, 2021 01:26
An example trigger function with asyncio in python
import asyncio
async def trigger(delay):
while True:
print("Triggered telemetry generation")
await asyncio.sleep(delay)
async def main(delay, duration):
task = asyncio.create_task(trigger(delay))
loop = asyncio.get_event_loop()
loop.call_later(duration, task.cancel)
try: