Skip to content

Instantly share code, notes, and snippets.

@KaidenP
KaidenP / LEMH Install Script
Last active December 11, 2015 10:00
This is a auto installer that installs the packages needed for a LEMH (Linux (E)nginx MariaDB (PHP) HHVM) install
#!/bin/sh
########################################################################
# #
# Kaiden's LEMH Installer #
# #
# This is a auto installer that installs the packages needed for #
# a LEMH (Linux (E)nginx MariaDB (PHP) HHVM) install. #
# #
# Credit to: http://www.maketecheasier.com/setup-lemh-stack-in-ubuntu/ #
@kei0719
kei0719 / phpmyadmin_on_hhvm.conf
Last active December 11, 2015 13:27
Nginx config example on HHVM 3.0
## here is phpmyadmin nginx
## environment
## OS: ubuntu 12.04
## Nginx: 1.4.7
## hhvm 3.0
## phpMyAdmin: 4.1.12
## locale: /etc/nginx/sites-available/phpmyadmin
@akamola
akamola / Perl.sublime-build
Created March 15, 2013 12:06
Sublime Text 2: Build system for Perl
{
"cmd": ["perl", "-w", "$file"],
"file_regex": ".* at (.*) line ([0-9]*)",
"selector": "source.perl"
}
@alihalabyah
alihalabyah / gist:4d39106eaa8fe48b481d
Created July 8, 2014 12:40
Clear Magento cart and quote items
<?php
// Clear Magento cart and quote items
$cart = Mage::getModel('checkout/cart');
$cart->truncate()->save(); // remove all active items in cart page
$cart->init();
$session= Mage::getSingleton('checkout/session');
$quote = $session->getQuote();
$cart = Mage::getModel('checkout/cart');
@christianroman
christianroman / OCR.java
Created May 15, 2012 01:59
Captcha OCR + Tesseract
public class OCR {
private static final String INPUT = "C:/captcha/ex.png";
private static final String OUTPUT = "C:/captcha/captcha-out.png";
private static final String TESSERACT_BIN = "C:/Program Files/Tesseract-OCR/tesseract.exe";
private static final String TESSERACT_OUTPUT = "C:/captcha/out.txt";
private static final int WHITE = 0x00FFFFFF, BLACK = 0x00000000;
public static void main(String... args) throws Exception {
BufferedImage image = ImageIO.read(new FileInputStream(INPUT));
int average = 0;
@hollodotme
hollodotme / Install-php7.md
Last active August 11, 2022 06:23
Installing php7-fpm with phpredis and xdebug extension on Ubuntu 14.04

Install php7.0-fpm

# remove php5 modules
apt-get autoremove --purge php5-*
# add php-7.0 source list by [Ondřej Surý](https://github.com/oerdnj)
add-apt-repository ppa:ondrej/php
# Update index
apt-get update
# Install php7.0-fpm with needed extensions
@janikvonrotz
janikvonrotz / Install WordPress Blog.md
Created March 3, 2014 08:21
Step by Step: Install WordPress Blog #PHP #MySQL #Nginx #phpMyAdmin #WordPress #Markdown #Ubuntu

Finishing this guide you'll get:

  • A running WordPress installation
  • Nginx proxy with PHP and Fast CGI
  • MySQL server accessible with phpMyAdmin

Specification of latest running installation:

  • Date: 03.03.2014
@u0d7i
u0d7i / disable_vim_auto_visual_on_mouse.txt
Last active February 27, 2024 14:08
Disable vim automatic visual mode on mouse select
Disable vim automatic visual mode on mouse select
issue: :set mouse-=a
add to ~/.vimrc: set mouse-=a
my ~/.vimrc for preserving global defaults and only changing one option:
source $VIMRUNTIME/defaults.vim
set mouse-=a
@vertexclique
vertexclique / cracking.md
Last active April 8, 2024 18:24
Cracking guide for Sublime Text 3 Build 3059 / 3065 ( Mac / Win x86_64 / Windows x86 / Linux x64 / Linux x86 )

MacOS

Build 3059

MD5: 59bab8f71f8c096cd3f72cd73851515d

Rename it to: Sublime Text

Make it executable with: chmod u+x Sublime\ Text

@rometsch
rometsch / i3autolock.md
Last active April 14, 2024 16:52
Configure lockscreen for i3 window manager.

The i3-wm does not come with a keybinding to lock the screen or a preconfigured auto lockscreen. This gist describes how to setup both using i3lock and xautolock. i3lock is a minimalistic lockscreen and xautolock monitors mouse and keyboard activities to automatically lock the screen after a certain time of beiing inactive.

First get the tools if neccessary. E.g. sudo apt install i3lock xautolock.

To setup the keybinding Ctrl+Alt+l (last one is a lowercase L) to lock the screen append the following lines to the i3 configuration file located at ~/.config/i3/config.

# keybinding to lock screen