Skip to content

Instantly share code, notes, and snippets.

View ravenstar's full-sized avatar

ravenstar

  • Australia
View GitHub Profile
@ravenstar
ravenstar / evil.js
Last active August 29, 2015 14:23 — forked from bmeck/evil.js
;(function () {
// random is ... less random
var _random = Math.random.bind(Math);
Math.random = function random() {
return _random() / 1;
}
// setInterval becomes nested setTimeout
var _setTimeout = setTimeout;
# These are my notes from the PragProg book on CoffeeScript of things that either
# aren't in the main CS language reference or I didn't pick them up there. I wrote
# them down before I forgot, and put it here for others but mainly as a reference for
# myself.
# assign arguments in constructor to properties of the same name:
class Thingie
constructor: (@name, @url) ->
# is the same as:
@ravenstar
ravenstar / auto-restart-nodejs-process
Created July 7, 2016 07:04 — forked from luozhihua/auto-restart-nodejs-process
Auto restart nodejs process when program exit
var child_process = require('child_process');
start();
function start(nodefile) {
if (typeof start !== 'string') {
console.log('Has none file. like this: start("app.js")');
}
console.log('Master process is running.');
@ravenstar
ravenstar / InterceptorThing.ps1
Created January 25, 2018 11:27
Interceptor - Normal User No Admin Required.
<#
.SYNOPSIS
This script demonstrates the ability to capture and tamper with Web sessions.
For secure sessions, this is done by dynamically writing certificates to match the requested domain.
This is only proof-of-concept, and should be used cautiously, to demonstrate the effects of such an attack.
Function: Interceptor
Author: Casey Smith, Twitter: @subTee
License: BSD 3-Clause
@ravenstar
ravenstar / child-functions-php-snippet.php
Last active July 19, 2018 04:03 — forked from lots0logs/child-functions-php-snippet.php
WordPress :: Divi Theme :: Include Tags In Post Meta When Displayed On Frontend
<?php
/* DON'T copy the first line (above) if your functions.php already has it.
* ----------------------------------------------------------------------- */
function et_pb_postinfo_meta( $postinfo, $date_format, $comment_zero, $comment_one, $comment_more ){
$postinfo_meta = '';
if ( in_array( 'author', $postinfo ) )
$postinfo_meta .= ' ' . esc_html__('by', 'et_builder') . ' <span class="author vcard">' . et_pb_get_the_author_posts_link() . '</span>';
if ( in_array( 'date', $postinfo ) ) {
$postinfo_meta .= '<span class="published">' . esc_html(get_the_time(wp_unslash( $date_format) ) ) . '</span>';
@ravenstar
ravenstar / Configure Exim on cPanel to use Mailgun SMTP
Created May 7, 2021 11:36 — forked from rmckeel/Configure Exim on cPanel to use Mailgun SMTP
Method for redirecting all email on a Linux WHM server for one domain to Mailgun for reliable delivery
# This allows you to route all email from a Linux WHM server using exim through the Mailgun service
# or other email service. This is very powerful because email from a server is typically untrusted
# and hard to get good email delivery.
# This is not tested on servers that host multiple domains, because Mailgun's service is specific
# to one domain. If you figure out multiple domains with Mailgun, write it in the comments or fork this!
# Log in to WHM, go to Exim Configuration Manager -> Advanced Editor tab then edit the following.
### NOTE!
# If setting hosts_require_auth and hosts_require_tls = smtp.mailgun.org,
List of things I do in Brave Browser after installing.
1) In welcome tour, make sure you are not using Brave rewards
2) Install ublock origin. While Brave's inbuilt ad-block is good, ublock origin is better.
3) Optional extensions - Video Speed controller, Sponsor block, Advanced Profanity Filter
4) Settings -> Search for "dashboard" -> Customize ... page -> Turn off sponsored images
5) In Newtab page, there are some cards like Binance, Crypto etc.
Click on Edit Cards at the bottom and hide the onnes you don't need
6) Enable Password autogenerate - In brave://settings/braveSync, click start new sync chain -> phone. It will generate QR code
But you don't have to use it. Click on manage your devices. Make sure sync everything is enabled.
@ravenstar
ravenstar / hfsc-shape.sh
Created April 16, 2023 06:36 — forked from eqhmcow/hfsc-shape.sh
HFSC - linux traffic shaping's best kept secret
#!/bin/bash
# As the "bufferbloat" folks have recently re-discovered and/or more widely
# publicized, congestion avoidance algorithms (such as those found in TCP) do
# a great job of allowing network endpoints to negotiate transfer rates that
# maximize a link's bandwidth usage without unduly penalizing any particular
# stream. This allows bulk transfer streams to use the maximum available
# bandwidth without affecting the latency of non-bulk (e.g. interactive)
# streams.