Skip to content

Instantly share code, notes, and snippets.

@KuLi
KuLi / gcrgc.sh
Created September 8, 2017 10:21 — forked from ahmetb/gcrgc.sh
Script to clean up Google Container Registry images pushed before a particular date
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@KuLi
KuLi / install-redis.sh
Created January 31, 2017 06:14 — forked from FUT/install-redis.sh
Install Redis on EC2
1. Install Linux updates, set time zones, followed by GCC and Make
sudo yum -y update
sudo ln -sf /usr/share/zoneinfo/America/Indianapolis \
/etc/localtime
sudo yum -y install gcc make
2. Download, Untar and Make Redis 2.8 (check here http://redis.io/download)
@KuLi
KuLi / ocp.php
Created September 29, 2016 11:45 — forked from ck-on/ocp.php
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2015-09-01 regex fix for PHP7 phpinfo
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
@KuLi
KuLi / gist:c6d5d48e4bc968da5b03
Created September 10, 2015 07:36
JS window.open center on screen
http://stackoverflow.com/a/16861050
@KuLi
KuLi / gist:c04058c49a34c65fbd6a
Created July 8, 2015 13:40
redis delete non matching
redis-cli keys "*" | grep -v 'MATCHPATTERN' | xargs redis-cli DEL
#example
# key: user:session:1
# key: user:login:1
# key: user:activity:1
# key: user:session:1
# key: shop:session:2
# key: shop:session:3
@KuLi
KuLi / gist:34c420b5feb53b544894
Created January 23, 2015 12:19
nvm global installation
http://stackoverflow.com/questions/11542846/nvm-node-js-recommended-install-for-all-users
@KuLi
KuLi / gist:bddf932099c763a0cbf6
Created October 24, 2014 18:56
PuPHPet Phalcon installation CentOS
#!/bin/bash
# /puphpet/files/exec-once/phalcon.sh
yum install php-devel php-mysql gcc libtool
git clone --depth=1 git://github.com/phalcon/cphalcon.git
cd cphalcon/build
./install
echo 'extension=phalcon.so' >> /etc/php.d/phalcon.ini
service httpd restart
service php-fpm restart
function verify_app_store_in_app($receipt, $is_sandbox)
{
//$sandbox should be TRUE if you want to test against itunes sandbox servers
if ($is_sandbox)
$verify_host = "ssl://sandbox.itunes.apple.com";
else
$verify_host = "ssl://buy.itunes.apple.com";
$json='{"receipt-data" : "'.$receipt.'" }';
//opening socket to itunes
<?php
// http://www.elasticsearch.com/docs/elasticsearch/rest_api/
class ElasticSearch {
public $index;
function __construct($server = 'http://localhost:9200'){
$this->server = $server;
}