Skip to content

Instantly share code, notes, and snippets.

View hypnoJerk's full-sized avatar
:atom:
Remember Atom? 💔

Shaun H. hypnoJerk

:atom:
Remember Atom? 💔
  • Blockheads Development, INC
  • Fresno, CA
  • X @unX
View GitHub Profile
@hypnoJerk
hypnoJerk / asciinema_iframe.sh
Last active April 4, 2023 05:59
Convert asciinema public share URL to iframe embed
#!/bin/bash
# https://gist.github.com/hypnoJerk/781d9c33bd64d059bc467ed9e2e54fb2
#
# Example usage:
# ./generate_iframe.sh https://asciinema.org/a/335480 -r 20 -c 90 -h 480px
# You may need to adjust the height, rows, or columns
# Extract the Asciicast ID from the URL
url=$1
@hypnoJerk
hypnoJerk / stylus-npmjs-com.css
Created May 19, 2022 22:51
Stylus Dark Theme for npmjs.com
@-moz-document domain("npmjs.com") {
html,body,main {
background-color: black !important;
color: white !important;
}
header,
header>div,
bg-white
{
background-color: black !important;
@hypnoJerk
hypnoJerk / stylus-nextjs-org.css
Last active May 18, 2022 23:56
A much needed Stylus dark theme for nextjs.org documentation section. https://addons.mozilla.org/en-US/firefox/addon/styl-us/
@-moz-document domain("nextjs.org") {
html,
header,
body {
background-color: black !important;
color: #ccc !important;
}
.react-autosuggest__suggestion mark {
background: #480043;
@hypnoJerk
hypnoJerk / PushLocalToNewRemoteMaster.md
Last active April 5, 2022 19:37
Push Existing Local Branch to Remote Master on New Github Repository

check remote

git remote -v

remove old remote

git remote rm <remote-name>

check remote that its gone

// Hackmud Token API
//
// Authors:
// nlight (aka facebook.com)
//
// -- Motivation --
//
// The token API allows for the existence of unhackable* user issued in-game currencies running on a network of FULLSEC scripts.
// Each implementation (instance) of the API represents a supply of tokens (currency) the ownership of which can be transferred
// securely between users. The user who hosts the token script (the issuer) is in full control of the supply and can issue new
@hypnoJerk
hypnoJerk / sd_backup.txt
Last active October 4, 2016 23:56
Make SD image backup and restore - linux
#First take note of which drive, and replace sdb with your volume name.
#Create Backup
sudo dd bs=4M if=/dev/sdb | gzip > /home/your_username/image'date +%d%m%y'.gz
#Restore backup
sudo gzip -dc /home/your_username/image.gz | dd bs=4M of=/dev/sdb
@hypnoJerk
hypnoJerk / access_ip_count.sh
Created June 5, 2016 19:36
Parse apache2 access.log; display unique ip's on each line with a count of how many times it occurs. Sorts them
#!/bin/bash
#Parse apache2 access.log
#And count how many times an IP appears and sorts them
cat /var/log/apache2/access.log | awk '{print $1}' | sort | uniq -c | sort -n | tail
@hypnoJerk
hypnoJerk / twython_oauth_test.py
Created April 7, 2016 08:59
Test your Twitter OAuth keys with this simple Python script
#!/usr/bin/env python
import sys, time
from twython import Twython
CONSUMER_KEY = 'xxxxx'
CONSUMER_SECRET = 'xxxxx'
ACCESS_KEY = 'xxxx-xxxx'
ACCESS_SECRET = 'xxxx'
print('Starting')
@hypnoJerk
hypnoJerk / external_ip_output.py
Created April 7, 2016 08:36
Simple Python script uses cURL to make a txt file with your devices external IP address. After that, you can email it, tweet it, or anything you want. I use this with my Raspberry Pi, and a Twitter bot
import os
def erase_file():
with open('/home/user/external_ip_output.txt', 'w'):
pass
def get_ip():
stream = os.popen('curl ifconfig.me --max-time 7 -o /home/user/external_ip_output.txt')
return stream
def open_file():
f = open('/home/user/external_ip_output.txt', 'r')
text = f.read()
@hypnoJerk
hypnoJerk / README.md
Last active July 3, 2023 16:51
from_twitter_to_telegram

Twitter >> Telegram

Auto post tweets from Twitter, to a Telegram bot

This script simply takes a twitter user name, and fetches the latest tweets from their timeline. Then reposts those tweets to a telegram bot(or channel via a bot)

####Requirements: You need Twython installed. Twython is a twitter-python API

####Notes: