Skip to content

Instantly share code, notes, and snippets.

View tjunussov's full-sized avatar

Tim TJey Jun tjunussov

View GitHub Profile
#!/usr/bin/lua
require "nixio"
print("Access-Control-Allow-Origin: *\n")
local utf8_decode={
[128]={[147]='\150',[148]='\151',[152]='\145',[153]='\146',[154]='\130',[156]='\147',[157]='\148',[158]='\132',[160]='\134',[161]='\135',[162]='\149',[166]='\133',[176]='\137',[185]='\139',[186]='\155'},
[130]={[172]='\136'},
[132]={[150]='\185',[162]='\153'},
@tjunussov
tjunussov / escpos-p.html
Created August 8, 2016 06:48
ESC-P Format
------------------------------------------ E1.xml ----------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<page width="112" line-height="9" margin-left="10" margin-right="122" printer="EPSON LX 300+II">
<table line-height="4">
<tc>
<td>-------------------------------------------</td>
<td>| КОПИЯ EMS KAZPOST/EMS KAZPOST КОШИРМЕСИ |</td>
<td>-------------------------------------------</td>
</tc>
<tc>
@tjunussov
tjunussov / nginx.conf
Created April 22, 2016 18:28
Nginx Configurations
try files in file system or proxy_pass it
******************************************
location /reports/ {
try_files $uri @reports;
}
@tjunussov
tjunussov / nginx_compile.txt
Created April 22, 2016 16:42
Compile Custom Nginx
./configure \
--user=nginx \
--group=nginx \
--prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/run/nginx.lock \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
@tjunussov
tjunussov / SSLPoke.java
Created April 16, 2016 18:34
Confluence Email Send SSL issue - Add certificate to java keystore ( Linux )
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
*/
public class SSLPoke {
public static void main(String[] args) {