Skip to content

Instantly share code, notes, and snippets.

View jeremylowery's full-sized avatar

Jeremy Lowery jeremylowery

  • EHO
  • Temple, TX
View GitHub Profile
@cdsaenz
cdsaenz / index.html
Created August 19, 2022 14:11
Demo Alpine JS and Fetch from Remote API
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Alpine Ajax test</title>
</head>
<body>
<h1>Users API Retrieval Test</h1>
@kissgyorgy
kissgyorgy / listen.py
Created September 4, 2020 16:37
How to use PostgreSQL's LISTEN/NOTIFY as a simple message queue with psycopg2 and asyncio
import asyncio
import psycopg2
# dbname should be the same for the notifying process
conn = psycopg2.connect(host="localhost", dbname="example", user="example", password="example")
conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT)
cursor = conn.cursor()
cursor.execute(f"LISTEN match_updates;")
@dabumana
dabumana / SetIPTables.sh
Last active May 4, 2022 23:32
A ready to use firewall configuration IPTABLES (FRAGMENTPACKAGE, XMAX, LAND, SMURF PORTKNOCKING).
#!/bin/bash
# Flash the current table
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F
# Log current scan
iptables -A INPUT -j LOG
iptables -A FORWARD -j LOG
iptables -A OUTPUT -j LOG
@joeharr4
joeharr4 / ssh-cipher-benchmark.sh
Last active April 20, 2024 05:38 — forked from dlenski/ssh-cipher-benchmark.sh
Check speed of ssh cipher(s) on your system
#!/bin/bash
# ssh-cipher-benchmark.sh - Assesses speed of SSH encryption between specific hosts.
# Usage:
# ssh-cipher-benchmark.sh <remotehost> [ciphers]
# Default ciphers: all we can find...
#
# Note: In some cases, the first cipher tested runs faster than the others, regardless of order.
# Cause of this is not known, but changing the order of testing shows it to be true. Run the
# first one twice if you suspect this. Perhaps it is due to buffering?
@fxkraus
fxkraus / debian-install-megacli.md
Last active April 30, 2024 04:09
Install LSI MegaCli .deb package on Debian/Ubuntu

download

wget https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/8-07-14_MegaCLI.zip

unzip

unzip 8-07-14_MegaCLI.zip
@schmohlio
schmohlio / sse.go
Last active February 13, 2023 08:38 — forked from ismasan/sse.go
Example SSE server in Golang
// v2 of the great example of SSE in go by @ismasan.
// includes fixes:
// * infinite loop ending in panic
// * closing a client twice
// * potentially blocked listen() from closing a connection during multiplex step.
package main
import (
"fmt"
"log"
@campoy
campoy / home.tmpl
Last active May 4, 2022 19:19
Electron-like html+golang app
<html>
<head>
<title>Hello, from Go</title>
</head>
<body>
<h1>Hello</h1>
<p>
This is Go code running, {{.}}
</p>
</body>
@kracekumar
kracekumar / ws_app.py
Last active October 5, 2021 08:52
Simple websocket server with uvloop.
# -*- coding: utf-8 -*-
import asyncio
import uvloop
from aiohttp.web import Application, MsgType, WebSocketResponse
def add_socket(app, socket, user_id):
if user_id in app['connections']:
pass
#!/usr/bin/python
# -*- coding: utf-8 -*-
# [SNIPPET_NAME: Systray icon]
# [SNIPPET_CATEGORIES: PyGTK]
# [SNIPPET_DESCRIPTION: Shows a system tray icon with a menu ]
# [SNIPPET_AUTHOR: João Pinto <joao.pinto@getdeb.net>]
# [SNIPPET_LICENSE: GPL]
#
# adapted from: http://eurion.net/python-snippets/snippet/Systray%20icon.html
@iamralch
iamralch / ssh_client.go
Last active April 16, 2023 03:09
SSH client in GO
package main
import (
"fmt"
"io"
"io/ioutil"
"net"
"os"
"strings"