Skip to content

Instantly share code, notes, and snippets.

View kennyLtv's full-sized avatar

Kenny Lindelof kennyLtv

View GitHub Profile
@kennyLtv
kennyLtv / rsycn_retry_on_fail
Last active May 15, 2019 15:04
rsync reconnect on a failed transfers
#!/bin/bash
while [ 1 ]
do
rsync -avz --progress <user>@<host>:/usr/www/dmfrenzycom/public /var/www/vhosts/dmfrenzy.com/test/public
if [ "$?" = "0" ]; then
echo "rsync completed on its own";
exit
else
echo "We failed, gotta catch them all";
sleep 20;
@kennyLtv
kennyLtv / plesk_associate
Created January 27, 2019 02:37
Plesk SQL Database registration from new line file
## Reads from piped file to get list of dbs to register
while read i; do plesk bin database --register $i -domain dmfrenzy.com -server localhost; done
@kennyLtv
kennyLtv / random_string.js
Created July 20, 2018 16:26
Insert random 12 character string into DOM element by ID
/*
* @Author: kennyL
* @Date: 2018-07-20 11:47:19
* @Last Modified by: kennyL
* @Last Modified time: 2018-07-20 12:16:05
*/
window.addEventListener("load", makePassword);
function makePassword() {
document.getElementById("password").innerHTML = btoa(Math.random()).substr(5, 12);
}
alias ll='ls -lG'
# Docker Compose Alias'
alias dcr='docker-compose down; docker-compose up -d;'
alias dcs='docker-compose up -d;'
alias dcd='docker-compose down;'
alias dclms='docker-compose exec app php artisan migrate:fresh; docker-compose exec app php artisan db:seed'
alias nah="git reset --hard;git clean -df;"

Keybase proof

I hereby claim:

  • I am kennyltv on github.
  • I am kennyltv (https://keybase.io/kennyltv) on keybase.
  • I have a public key ASAgRTgVy9N7iOdXBVNGZKxXg5r_ViMStsp34KIKgL5qNgo

To claim this, I am signing this object:

@kennyLtv
kennyLtv / .htaccesshttps
Last active February 26, 2018 17:26
HTTPS && www -> non www
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
@kennyLtv
kennyLtv / new_gist_file.js
Created February 14, 2018 20:55 — forked from nmsdvid/new_gist_file.js
Simple JavaScript Debounce Function
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
clearTimeout(timeout);
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@kennyLtv
kennyLtv / README-Template.md
Created May 18, 2017 18:46 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@kennyLtv
kennyLtv / config
Last active May 17, 2017 18:11
RankMe Web Interface example config
<?php
require_once("control/queryFunctions.php");
require_once("control/class.Player.php");
require_once("control/class.Server.php");
$pageTitle = '';
$weaponsArray = array("m4a1_silencer","m4a1","ak47","awp","knife","usp_silencer","hkp2000","elite","p250","fiveseven","cz75a","deagle","glock","tec9","famas","aug","galilar","sg556","hegrenade","flashbang","smokegrenade","inferno");
$webTitle = '';
$dbh = new PDO("mysql:host=examplehost ;dbname=exampledb ", 'db_user', 'db_pass ');
$webURL = ' ';
$sbURL = ' ';