Skip to content

Instantly share code, notes, and snippets.

View nevrending's full-sized avatar
🍰
The cake is a lie.

Yefta Sutanto nevrending

🍰
The cake is a lie.
View GitHub Profile
@superseb
superseb / readme.md
Created November 9, 2017 15:02
Restore MySQL database on bind-mounted directory for rancher/server

Restore MySQL database on bind-mounted directory for rancher/server

When you run rancher/server with a bind-mounted directory, both processes (MySQL and cattle) are always running so it can be hard to restore a backup.

Backup

Creating a backup can be done using:

docker exec rancher_server_id mysqldump --default-character-set=utf8 --databases cattle > cattle.sql

This will save the database called cattle (default) to cattle.sql on the host.

@blackgate
blackgate / mbp2011-disable-amd-gpu.md
Last active May 9, 2025 17:13
Macbook Pro 2011 - Disable AMD GPU
@stroebs
stroebs / make-chr.sh
Last active January 19, 2025 10:59
Install Mikrotik CHR on a Digital Ocean droplet (Ubuntu 20.04 tested working 29/03/2022)
#!/bin/bash
#
# Digital Ocean Ubuntu 18.04 x64 Droplet with "Regular Intel" CPU.
# Running:
# git clone https://gist.github.com/54fc09734a3911e91eeeb43434f117df.git
# cd 54fc09734a3911e91eeeb43434f117df/
# chmod +x make-chr.sh
# ./make-chr.sh
#
# Once the reboot is done, login with root/CHANGEME and change the password!
@tperalta82
tperalta82 / damnedd3.php
Last active May 3, 2018 23:43
Reboot D3 on fail board
#!/usr/bin/php
<?php
$hosts = array("antminer1","antminer2");
$minercreds = array( "user" => "root", "pass" => "becauseIAmHigh");
$failhashboard = "oxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx xxxx";
/* I'm too stoned to try and detect how many hashboards are there*/
$possiblehashboards = 4;
foreach($hosts as $host)
{
@6footgeek
6footgeek / ipToAsnLookup.php
Created August 23, 2017 09:54
IP to ASN lookup PHP
private function getAsnFromIP($ip)
{
$query = 'whois -h whois.cymru.com " -f ' . (string) $ip . '"';
$whoisResult = shell_exec($query);
$asnArray = explode('|', $whoisResult);
$cleanAsn = array_map('trim', $asnArray);
return $cleanAsn;
}

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment

@sebastienvercammen
sebastienvercammen / Code.gs
Last active February 9, 2025 11:45
Nintendo PTC Account Verifier for Gmail v2 with CORS proxy (via Google Scripts & jQuery)
/*
Automatically click all "Verify your email" links in the welcome e-mail from
Nintendo Pokémon Trainer Club's signup e-mails.
Only unread emails in inbox will be processed.
All processed e-mails will be marked as read if verification was successful,
and optionally moved to trash if it's enabled in your settings.
How to use:
1. Login to Gmail
@fevangelou
fevangelou / my.cnf
Last active January 27, 2025 11:12
Optimized my.cnf configuration for MySQL/MariaDB (on cPanel/WHM servers)
# === Optimized my.cnf configuration for MySQL/MariaDB (on cPanel/WHM servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated September 2024 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@dogrocker
dogrocker / autocomplete_suggest.md
Last active April 19, 2016 03:57
Autocomplete with Laravel 5.1 & Materializecss & Typeahead.js
  • View index.blade.php
<div class="row">
    {!! Form::open(['route' => 'some.route', 'autocomplete' => 'off', 'class' => 'col s12']) !!}
      <div class="row">
        <div class="input-field col s6">
          {!! Form::text('username', isset($user->username) ? $user->username : '', ['id' => 'username', 'placeholder' => '']) !!}
          {!! Form::label('username', 'Username') !!}
        </div>
      </div>
@Iman
Iman / clean.sh
Last active May 7, 2025 10:50
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/bin/sh
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs