Skip to content

Instantly share code, notes, and snippets.

View x0x8x's full-sized avatar
🏠
Working from home

x0x8x x0x8x

🏠
Working from home
View GitHub Profile
#!/bin/bash
# First verify the version of Java being used is not Oracle JDK.
java -version
# Get the latest Oracle Java SDK http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
wget -c --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u31-b13/jdk-8u31-linux-x64.rpm" --output-document="jdk-8u31-linux-x64.rpm"
# Install Java SDK
sudo rpm -i jdk-8u31-linux-x64.rpm
@x0x8x
x0x8x / gist:6127738a049ecd4e34ba
Last active August 31, 2015 09:27 — forked from jgrossiord/gist:0bd525974a5ec059adba
Mikrotik script generate address list from DNS cache entries
:foreach i in=[/ip dns cache find] do={
:local bNew "true";
:local cacheName [/ip dns cache all get $i name] ;
# :put $cacheName;
:if (([:find $cacheName "facebook" -1] >= 0) || ([:find $cacheName "outlook" -1] >= 0)) do={
:local tmpAddress [/ip dns cache get $i address] ;
:put $cacheName;
:put $tmpAddress;
@x0x8x
x0x8x / gist:072ff076b4f6c448203f824332ae6fe8
Created May 25, 2016 01:31 — forked from sgergely/gist:3793166
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@x0x8x
x0x8x / 0_reuse_code.js
Created June 29, 2016 16:05
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@x0x8x
x0x8x / git-export
Created May 12, 2017 02:40 — forked from toru-hamaguchi/git-export
Export files.
#!/bin/sh -
IFS="
"
OPTIONS_KEEPDASHDASH=
OPTIONS_SPEC="\
git export <options> <rev>{0,2}
--
o= Export directory.
// ==UserScript==
// @name Open Feedly in Background
// @author toru hamaguchi
// @namespace https://gist.github.com/toru-hamaguchi/9916038#file-userscript-js
// @description Open Feedly feed item in background tab.
// @license Creative Commons Attribution License
// @version 0.1
// @include http*://feedly.com/*
// @compatible Greasemonkey
// ==/UserScript==
@x0x8x
x0x8x / gist:c6623516f4b0c95fed95479428da54b6
Created May 12, 2017 09:54 — forked from baskarp/gist:3291141
How to setup Python command line tool for PagerDuty
Here is a quick instructions on how to setup the Python command line tool for PagerDuty.
1) You'll need to have Python installed (tested with Python 2.6.1)
2) Verify if Python setuptools are installed
python -c "import setuptools;print 'OK';"
if you don't see output "OK", then setuptools are not installed.
To install setuptools, download setuptools (http://pypi.python.org/pypi/setuptools/) appropriate to your Python major version. ("python --version" to get the version number).
Import-Module ActiveDirectory
#Import users via the PD API, echo results
function POST_Request ($url,$parameters, $api_key) {
$http_request = New-Object -ComObject Msxml2.XMLHTTP
$http_request.open('POST', $url, $false)
$http_request.setRequestHeader("Content-type", "application/json")
$token = "Token token=" + $api_key
$http_request.setRequestHeader("Authorization", $token)
$http_request.setRequestHeader("Content-length", $parameters.length)
@x0x8x
x0x8x / PagerDuty_Migration.js
Created May 12, 2017 09:56 — forked from baskarp/PagerDuty_Migration.js
Migration script to move from legacy PagerDuty update set integration to the new Fuji ServiceNow store app
/*
* Must be run from backgroup script as a user with the elevated security_admin role
*/
// migrate incident id values
migrateIncidents();
// migrate group attributes from legacy update set application to the new Fuji store app
migrateGroups();