Skip to content

Instantly share code, notes, and snippets.

View leotm's full-sized avatar

LeoTM leotm

View GitHub Profile
@leotm
leotm / win10lnks.txt
Created August 6, 2015 13:15
Windows 10 shortcuts
Quick Launch: C:\Users\<User>\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch
TaskBar: C:\Users\<User>\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar
Start Menu: C:\Users\<User>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
Links: C:\Users\<User>\.cr3\Links
@leotm
leotm / git-bash-shell-cmd.lnk
Last active September 24, 2017 07:17
GitHub for Windows - Git Bash shell shortcut
Target: C:\Windows\System32\cmd.exe /c ""C:\Users\<User>\AppData\Local\GitHub\<Git folder>\bin\sh.exe" --login -i"
Start in: C:\Users\<User>\Documents\GitHub
@leotm
leotm / git-cmd.bat
Last active August 29, 2015 14:26
GitHub for Windows - amended git-cmd.bat path to open in "Documents\GitHub" folder
@rem Do not use "echo off" to not affect any child calls.
@setlocal
@rem Get the absolute path to the current directory, which is assumed to be the
@rem Git installation root.
@for /F "delims=" %%I in ("%~dp0") do @set git_install_root=%%~fI
@set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%git_install_root%\cmd;%PATH%
@if not exist "%HOME%" @set HOME=%USERPROFILE%\Documents\GitHub
@if not exist "%HOME%" @set HOME=%USERPROFILE%
@leotm
leotm / page.is_addLink.js
Last active August 29, 2015 14:27
Page.is - Add Link - add more social profiles
@leotm
leotm / insta.friendorfollow.com_bulk.js
Created August 17, 2015 12:20
Instagram - Friend or Follow - Bulk Unfollow/Follow
// So I wrote this purely to reverse getting hacked
// Resulting in following an extra 800 random people
// Always de-activate third-party tools after API authorisation!
// Enter into your browser console
var items = document.querySelectorAll("#content > div > img");
for (var i = 0; i < items.length; i++) {
// Simulates mouse hover over user images to open tooltips
// (Prevously tried amending the results classes and attributes)
@leotm
leotm / page.hbs
Created October 9, 2015 12:12 — forked from geekhunger/page.hbs
Ghost - List of posts inside post.hbs and page.hbs
...
{{> posts_list}}
...
@leotm
leotm / login.conf
Last active February 5, 2016 11:47
OpenVPN server authentication with .ovpn files
// For automated authentication of .ovpn files
<username>
<password>
// Ensure login.conf is in the same directory as your .ovpn file
// Add the arguments 'auth-user-pass login.conf' to your .ovpn file
// To batch edit this multiple files, see: gist.github.com/leotm/377efbde1e7037bbebfa
@leotm
leotm / undo-all-facebook-ad-preferences.js
Last active December 3, 2016 00:51
How to Undo/Remove/Delete All Facebook Ad Preferences via the Console
/**
* @undo-all-facebook-ad-preferences.js
* Undo/Remove/Delete All Facebook Ad Preferences.
* Page: 'Your Ad Preferences'
* URL: https://www.facebook.com/ads/preferences/
* Instructions: Just paste each section to your Console.
*/
// Expand each Category
var selector = "div > div > div > div > ul > li";
$ `bash`
$ ssh <username>@<host> -p<port>
# Causes hang
$ bash
$ ssh <username>@<host> -p<port>
# Works
$ `ssh-agent`
bash: SSH_AUTH_SOCK=/tmp/ssh-ic83uMHi6MDg/agent.4932;: No such file or directory
@leotm
leotm / php_check.php
Last active June 12, 2016 18:00
PHP Options/Info Functions
// It seems PDO attributes are set per connection establishment
// Rather than checking if the attribute is what we desire first, if so not executing it at all
// So I wondered, should the PHP options be just set each connection like PDO?
// Refresh
var_dump(memory_get_usage()); // 167704
if (ini_get('error_reporting') != '22527')
ini_set('error_reporting', 'E_ALL');
var_dump(memory_get_usage()); // 167704