Skip to content

Instantly share code, notes, and snippets.

View mainakibui's full-sized avatar

@mainakibui mainakibui

View GitHub Profile
" Buffers: shared hit=55070798 read=303167"
" I/O Timings: read=113222.552"
"Planning:"
" Buffers: shared hit=52 read=3"
" I/O Timings: read=11.635"
"Planning Time: 12.147 ms"
"Execution Time: 430756.466 ms"
@mainakibui
mainakibui / unfollow.js
Created April 22, 2021 18:58 — forked from JamieMason/unfollow.js.md
Unfollow everyone on twitter.com
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left)
// https://gist.github.com/JamieMason/7580315
//
// 1. Go to https://twitter.com/YOUR_USER_NAME/following
// 2. Open the Developer Console. (COMMAND+ALT+I on Mac)
// 3. Paste this into the Developer Console and run it
//
// Last Updated: 09 April 2020
(() => {
const $followButtons = '[data-testid$="-unfollow"]';
@mainakibui
mainakibui / inotify-trigger.sh
Created May 25, 2018 07:40 — forked from amorken/inotify-trigger.sh
Triggering a command when a file tree is changed using inotify
#!/bin/bash
# Watch a directory and run a script every time inotify reports that something
# changed, followed by 10 seconds of no changes. Handy for responding to incoming
# rsync jobs or the like.
#
# Requires that inotify-tools is installed.
WATCHDIR=${1:./}
TRIGGERCOMMAND=${2:-echo fired}
@mainakibui
mainakibui / generate-ssh-key.sh
Created January 31, 2018 08:02 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_rsa
@mainakibui
mainakibui / Props
Last active June 19, 2017 09:53 — forked from mynameispj/Props
Estimated reading time in PHP, by Brian Cray
Total props to Brian Cray: http://briancray.com/posts/estimated-reading-time-web-design/
@mainakibui
mainakibui / calc-read-time.php
Created June 16, 2017 12:10 — forked from norcross/calc-read-time.php
calculate and display an estimated reading time
<?php
/**
* handle the calculation
* @param integer $seconds [description]
* @return [type] [description]
*/
function rkv_calc_read_time( $seconds = 0 ) {
// calc the minutes
@mainakibui
mainakibui / monitor.sh
Created June 10, 2016 06:46 — forked from mheadd/monitor.sh
Simple bash script to check whether MySQL is running.
#!/bin/bash
UP=$(pgrep mysql | wc -l);
if [ "$UP" -ne 1 ];
then
echo "MySQL is down.";
sudo service mysql start
else
echo "All is well.";
fi
@mainakibui
mainakibui / README.md
Created November 16, 2015 08:08 — forked from magnetikonline/README.md
Reset Windows 2012R2 local administrator password.

Reset Windows 2012R2 local administrator password

  • Boot from Microsoft Windows Server 2012R2 DVD/ISO.
  • From the Windows Setup menu, click "Next".
  • Select "Repair your computer".
  • Click on "Troubleshoot".
  • Under Advanced options, click "Command Prompt".

At the command prompt, run the following commands:

#!/usr/bin/env python
import urllib2
from datetime import date
def main():
today = date.today()
suffix = getDateSuffix(today)
fdate = "%s %s%s %s" % (today.strftime('%b'),today.strftime('%d'),suffix,today.strftime('%Y'))
print("Downloading Daily Nation...")
$(document).ready(function(){
// Add the class submit to your 'submit' button :)
$(".submit").on('click', function(){
editor.post();
});
});