Skip to content

Instantly share code, notes, and snippets.

View lunaczp's full-sized avatar

Lunac lunaczp

View GitHub Profile
1. `vim /etc/syslog.conf`
2. Add to end of file: `cron.* /var/log/cron.log`
3.
```
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.syslogd.plist
sudo launchctl load /System/Library/LaunchDaemons/com.apple.syslogd.plist
```
[where-is-the-cron-log-file-in-macosx-lion](http://apple.stackexchange.com/questions/38861/where-is-the-cron-log-file-in-macosx-lion)
@lunaczp
lunaczp / redis-server
Created September 11, 2017 04:04 — forked from tessro/redis-server
A CentOS initscript for Redis
#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis.pid
@lunaczp
lunaczp / sources.repo
Last active June 26, 2017 10:20 — forked from n0ts/sources.repo
SRPM yum repository for CentOS 6
//set up env
bin/awk '{print$3}' < /etc/redhat-release > /etc/yum/vars/full_releasever
//contents of source.repo
[base-source]
name=CentOS-$full_releasever - Base source
baseurl=http://vault.centos.org/$full_releasever/os/Source/
gpgcheck=1
gpgkey=http://vault.centos.org//RPM-GPG-KEY-CentOS-6
priority=1
@lunaczp
lunaczp / object-watch.js
Created June 24, 2017 01:41 — forked from eligrey/object-watch.js
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@lunaczp
lunaczp / openssl-create-CA.sh
Created June 18, 2017 14:54 — forked from xynova/openssl-create-CA.sh
Create Root CA certs with openssl
# Create the Root CA private key
## ref> https://www.openssl.org/docs/manmaster/apps/genrsa.html
openssl genrsa -out myRootCA.key 4096
# Generate the Root CA certificate signed with the private key
## ref> https://www.openssl.org/docs/manmaster/apps/req.html
openssl req -x509 -new -nodes -key myRootCA.key -days 3650 -out myRootCA.pem
# Country Name (2 letter code) [AU]:AU
# State or Province Name (full name) [Some-State]:NSW
@lunaczp
lunaczp / 00. tutorial.md
Created May 16, 2017 08:16 — forked from maxivak/00. tutorial.md
Importing/Indexing database (MySQL or SQL Server) in Solr using Data Import Handler
@lunaczp
lunaczp / zend_vm_opcodes.h
Created January 23, 2017 09:15
php opcode table
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
| Copyright (c) 1998-2015 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
@lunaczp
lunaczp / arraySize.cpp
Last active December 31, 2016 06:54
c array size test
#include <iostream>
int sizeOfArray(int arr[]) {
std::cout << "sizeOf array in func:" << sizeof(arr) << std::endl;
std::cout << "sizeOf array[0] in func:" << sizeof(arr[0]) << std::endl;
return sizeof(arr) / sizeof(arr[0]);
}
int main() {
int arr[] = {1,2,3};
@lunaczp
lunaczp / http-benchmark.md
Created December 27, 2016 10:22 — forked from denji/http-benchmark.md
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)

Tools

Located in alphabetical order (not prefer)

  • ab – slow and single threaded, written in C
  • apib – most of the features of ApacheBench (ab), also designed as a more modern replacement, written in C
  • baloo – Expressive end-to-end HTTP API testing made easy, written in Go (golang)
  • bombardier – Fast crossplatform HTTP benchmarking tool, written in Go (golang)
  • curl-loader – performance loading of various application services and traffic generation, written in C
  • fasthttploader – benchmark (kinda ab) with autoadjustment and charts based on fasthttp library, write in Go (golang)