Skip to content

Instantly share code, notes, and snippets.

@illucent
illucent / fix-eol.sh
Created December 23, 2015 14:08 — forked from artzub/fix-eol.sh
List of tips on all cases of life
#!/bin/sh
git config core.autocrlf true #or input. I use input for windows in order to always will be LF.
git rm --cached -r .
git reset --hard
#git add .
#git commit -m "Normalize line endings"
@illucent
illucent / tagcloud.sh
Created December 22, 2015 21:03 — forked from karmi/tagcloud.sh
Simple tag cloud with ElasticSearch `terms` facet
# (Re)create the index
curl -X DELETE "http://localhost:9200/tagcloud"
curl -X PUT "http://localhost:9200/tagcloud"-d '{
"settings" : {
"index" : {
"number_of_shards" : 1,
"number_of_replicas" : 0
}
}
}'
@illucent
illucent / bash-template
Created December 22, 2015 14:47 — forked from renzok/bash-template
A template bash script based on google style guide with little improvements
#!/bin/bash
# Here short description of this script
# This is just a template to be used for writing new bash scripts
###
# Based on Google Style Guide: https://google-styleguide.googlecode.com/svn/trunk/shell.xml
# General remarks
# * Executables should have no extension (strongly preferred) or a .sh extension.
# * Libraries must have a .sh extension and should not be executable
@illucent
illucent / caesar-cipher.sh
Created December 19, 2015 20:59 — forked from IQAndreas/caesar-cipher.sh
A really simple Caesar Cipher in Bash (or Shell) using `tr`, can also easily be adjusted to encrypt/decrypt ROT13 instead.
# Caesar cipher encoding
echo "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG" | tr '[A-Z]' '[X-ZA-W]'
# output: QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD
# Caesar cipher decoding
echo "QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD" | tr '[X-ZA-W]' '[A-Z]'
# output: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
# Can also be adjusted to ROT13 instead
@illucent
illucent / time.js
Created December 19, 2015 11:56 — forked from franga2000/time.js
Functions to process time and time zones
//Get UTC/GMT Offset
new Date().getTimezoneOffset() / -60; /* Type: integer */
//Get timezone offset string: GMT, GMT+01:00, GMT-01:30
function getTimeZoneString() {
var num = new Date().getTimezoneOffset();
if (num === 0) {
return "GMT";
} else {
var hours = Math.floor(num / 60);

#Kali Linux on Acer Aspire Switch ##The problem What's the problem with this tablet? Why can't I just insert the USB and mash F12 until it boots? The tablet is made to run Windows 8.1 and Windows 8.1 only. Because of the stupidity that is UEFI (specifically it's "Safe boot" feature) we can't just boot from any USB stick we want. Also, because someone thought putting a 32-bit UEFI on a 64-bit system was a good idea.

NOTE: This guide focuses on installing Kali alongside Windows. If you're trying to replace Windows, then I assume you know enough about Linux to know which parts to change.

##Requirements Before you start, there's a few things you need:

@illucent
illucent / sencond_deploy.md
Created December 17, 2015 19:47 — forked from burningTyger/sencond_deploy.md
How to deploy your openshift app to a second instance

##How to deploy your openshift app to a second instance

I set up Moodle for myself on Openshift which I explained here: https://github.com/burningTyger/openshift_moodle

Now I wanted to install Moodle for a friend who has his own user and his own domain on openshift. Since I'm the admin why bother creating a second app which is basically the exact same app as mine and will most cetainly need the exact same updates. DRY!

So I decided to find out how I can use the app repo on two different instances of openshift. This is how it works (there might be better solutions, let me know):

You log in as the second user and create a new app. This will give you a git URL. Copy this URL and head over to you app repo (Moodle used in this example):

@illucent
illucent / spinner.sh
Created December 16, 2015 22:14
Bash Spinners
spinner()
{
local pid=$1
local delay=0.75
local spinstr='|/-\'
while [ "$(ps | awk '{print $1}' | grep $pid)" ]; do
local temp=${spinstr#?}
printf " [%c] " "$spinstr"
local spinstr=$temp${spinstr%"$temp"}
sleep $delay
@illucent
illucent / bubblejax.php
Created December 10, 2015 10:37 — forked from rocktronica/bubblejax.php
bubblejax.php before stripping wpdb stuff
<?php
/*
Plugin Name: BubbleJax Wrapper
Plugin URI: http://bubblelifemedia.com/
Description: Name pending.
Author: Tommy
Version: 0.1
Author URI: http://bubblelifemedia.com/
*/

In this article I'm going to walk you through process of creating Wordpress plugins. First I'm going to talk about some of the basic concepts in Wordpress plugin development like the actions, hooks, and API's that makes up Wordpress. Then were going to build a plugin where we apply some of the concepts and best practices in developing Wordpress plugins.

###Prerequisites

In order to fully benefit from this tutorial you should have a basic knowledge on PHP. As Wordpress is running on PHP and most of the code that we will be writing will be on PHP. A little bit of knowledge on HTML, CSS and JavaScript is also helpful but not required for this tutorial.