Skip to content

Instantly share code, notes, and snippets.

@ceberous
ceberous / twilio_call.py
Created April 27, 2020 11:33
Call Someone via Twilio
#!/usr/bin/env python3
import time
from twilio.rest import Client
# For $TWILIO_VOICE_RESPONSE_ENDPOINT , you have to setup some https POST endpoint ,
# that can return a "twilio ml" "voice response"
# These are expressjs examples
# const VoiceResponse = require( "twilio" ).twiml.VoiceResponse;
# app.post( "/twiliocall" , function( req , res ) {
@ceberous
ceberous / starText.py
Created April 17, 2020 05:01
Random Text Stuff
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import random , string , sys , warnings , json , os
if len( sys.argv ) < 2:
sys.exit( 1 )
# https://coolsymbol.com/cool-fancy-text-generator.html
# var fonts = document.querySelectorAll( "input.font-preview-content" );
# var to_copy = ""
# for ( let i = 0; i < fonts.length; ++i ) {
@ceberous
ceberous / twitchIgnoreEveryone.js
Last active September 14, 2019 20:50
Twitch Block / Ignore Everyone
const process = require( "process" );
const path = require( "path" );
const child = require( "child_process" );
const global_package_path = child.spawnSync( 'npm', [ 'root' , '-g' ] , { encoding: 'utf8' } ).stdout.trim();
const request = require( path.join( global_package_path , "request" ) );
const tmi = require( path.join( global_package_path , "tmi.js" ) );
const JFODB = require( path.join( global_package_path , "jsonfile-obj-db" ) );
const db = new JFODB( "already_blocked" );
if ( !!!db.self.already_blocked ) { db.self.already_blocked = {}; db.save(); }
@ceberous
ceberous / letsEncryptAutoRenew.sh
Last active June 1, 2019 22:20
Lets Encrypt Auto Renew
#!/bin/bash
ufw disable
pkill letsencrypt,certbot
find / -type f -name ".certbot.lock"
find / -type f -name ".certbot.lock" -exec rm {} \;
/opt/letsencrypt/certbot-auto renew >> /var/log/letsencrypt-renewal.log
/bin/systemctl reload nginx
/usr/bin/certbot renew --nginx
ufw enable
@ceberous
ceberous / Windows10HoldMicrophoneVolumeConstant.py
Created January 10, 2019 02:27
Windows 10 Hold Microphone Volume Constant
from subprocess import check_output
from threading import Timer
import os
# http://www.nirsoft.net/utils/nircmd.html
# http://www.nirsoft.net/utils/nircmd-x64.zip
NircCMD = os.path.join( "C:\\" , "Program Files" , "NirCmd" , "nircmd.exe" )
NircCMD = '"' + NircCMD + '"' + " setvolume 1 "
@ceberous
ceberous / networkRestart.bat
Created November 27, 2018 07:05
Windows Restart Network
# https://stackoverflow.com/questions/36085055/batch-file-to-enable-disable-network-adapter
# netsh interface show interface
netsh interface set interface "Wireless network connection" DISABLED
TIMEOUT /T 5
netsh interface set interface "Wireless network connection" ENABLED
@ceberous
ceberous / TwitchChatBanNonEnglish.js
Last active June 8, 2018 07:40
Twitch Chat Timeout / Ban Non English
const process = require( "process" );
const path = require( "path" );
const cp = require( "child_process" );
function get_node_global_path() {
try {
const output = cp.spawnSync( "npm" , [ "root" , "-g" ] , { encoding : "utf8" } );
return output.stdout.trim();
}
catch( error ) { console.log( error ); process.exit( 1 ); }
}
@ceberous
ceberous / SpringfieldSpringfieldGetScripts.js
Created June 6, 2018 04:48
springfieldspringfield.co.uk/episode_scripts.php Downloader
const path = require( "path" );
const process = require( "process" );
const fs = require( "fs" );
const cp = require( "child_process" );
function get_node_global_path() {
try {
const output = cp.spawnSync( "npm" , [ "root" , "-g" ] , { encoding : "utf8" } );
return output.stdout.trim();
}
catch( error ) { console.log( error ); process.exit( 1 ); }
@ceberous
ceberous / TwitchDownloadEmoteSet.js
Last active May 31, 2018 22:11
Downloads Twitch and BTTV Emote 1x Set
const cp = require( "child_process" );
function get_node_global_path() {
try {
const output = cp.spawnSync( "npm" , [ "root" , "-g" ] , { encoding : "utf8" } );
return output.stdout.trim();
}
catch( error ) { console.log( error ); process.exit( 1 ); }
}
const NodeGlobalPath = get_node_global_path();
@ceberous
ceberous / GetNodeGlobalPath.js
Created May 31, 2018 21:01
Returns Node Global Path
const cp = require( "child_process" );
function get_node_global_path() {
try {
const output = cp.spawnSync( "npm" , [ "root" , "-g" ] , { encoding : "utf8" } );
return output.stdout.trim();
}
catch( error ) { console.log( error ); process.exit( 1 ); }
}
const NodeGlobalPath = get_node_global_path();