# 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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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/ # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"cmd": ["perl", "-w", "$file"], | |
"file_regex": ".* at (.*) line ([0-9]*)", | |
"selector": "source.perl" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
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
OlderNewer