Skip to content

Instantly share code, notes, and snippets.

@aka-z
aka-z / slrclub.py
Created August 25, 2019 00:44 — forked from yoonbae81/slrclub.py
SLRCLUB 중고장터 모니터링
#!/usr/bin/env python3
### Configuration ################################################
SLRCLUB_USERID = 'XXXXXXXX'
SLRCLUB_PASSWD = 'XXXXXXXX'
TELEGRAM_TOKEN = '000000000:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
TELEGRAM_CHAT_ID = '000000000'
### End of Configuration #########################################
import argparse
@aka-z
aka-z / clien.py
Created August 25, 2019 00:43
클리앙 중고장터 모니터링
#!/usr/bin/env python3
### Configuration ################################################
CLIEN_USERID = 'XXXXXXXX'
CLIEN_PASSWD = 'XXXXXXXX'
TELEGRAM_TOKEN = '000000000:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
TELEGRAM_CHAT_ID = '000000000'
### End of Configuration #########################################
import argparse
@aka-z
aka-z / curl_example.cpp
Created August 8, 2019 04:45 — forked from alghanmi/curl_example.cpp
cURL C++ Example
#include <iostream>
#include <string>
#include <curl/curl.h>
static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp)
{
((std::string*)userp)->append((char*)contents, size * nmemb);
return size * nmemb;
}
@aka-z
aka-z / kt_starbucks_2019.py
Created July 26, 2019 11:28 — forked from chwnam/kt_starbucks_2019.py
스타벅스 와이파이 자동 인증 파이썬3 스크립트
import time
from http.cookiejar import Cookie
from re import search, findall
from urllib.parse import urlencode
from urllib.request import (
HTTPCookieProcessor,
HTTPRedirectHandler,
Request,
build_opener
)
@aka-z
aka-z / README-tomcat-as-systemd-service.md
Created April 21, 2019 14:07 — forked from drmalex07/README-tomcat-as-systemd-service.md
An example configuration for Tomcat as systemd service. #tomcat #systemd #systemd.service

README

Let Tomcat is download and installed under /opt/tomcat. Also, let tomcat be a non-provileged user under which the server will be running.

We assume that we keep server's binaries under /opt/tomcat and we will create a server instance named foo under /var/tomcat/ (carrying its own conf, logs, webapps, work, lib directories). See also https://dzone.com/articles/running-multiple-tomcat.

Create a template service unit file at /etc/systemd/system/tomcat@.service:

@aka-z
aka-z / firebase.cpp
Created March 30, 2019 09:10 — forked from janjongboom/firebase.cpp
HTTPS request to firebase.google.com using https://developer.mbed.org/teams/sandbox/code/mbed-http/
#include "mbed.h"
#include "easy-connect.h"
#include "https_request.h"
Serial pc(USBTX, USBRX);
/* List of trusted root CA certificates
* This is the root CA for Google from GeoTrustGlobalCA
*
* To add more root certificates, just concatenate them.
@aka-z
aka-z / XmlMappingTest.java
Created March 30, 2019 03:33 — forked from joaovarandas/XmlMappingTest.java
Possible Solution for UntypedObjectDeserializer
package test.com.inpaas.http.wsdl;
import java.io.IOException;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import com.fasterxml.jackson.core.JsonParseException;
Expression Utility Objects
Besides these basic objects, Thymeleaf will offer us a set of utility objects that will help us perform common tasks in our expressions.
#dates: utility methods for java.util.Date objects: formatting, component extraction, etc.
#calendars: analogous to #dates, but for java.util.Calendar objects.
#numbers: utility methods for formatting numeric objects.
#strings: utility methods for String objects: contains, startsWith, prepending/appending, etc.
#objects: utility methods for objects in general.
#bools: utility methods for boolean evaluation.
#arrays: utility methods for arrays.
Expression Utility Objects
Besides these basic objects, Thymeleaf will offer us a set of utility objects that will help us perform common tasks in our expressions.
#dates: utility methods for java.util.Date objects: formatting, component extraction, etc.
#calendars: analogous to #dates, but for java.util.Calendar objects.
#numbers: utility methods for formatting numeric objects.
#strings: utility methods for String objects: contains, startsWith, prepending/appending, etc.
#objects: utility methods for objects in general.
#bools: utility methods for boolean evaluation.
#arrays: utility methods for arrays.
@aka-z
aka-z / run-jar-as-a-service.md
Created February 27, 2019 01:39 — forked from marlonbernardes/run-jar-as-a-service.md
How to make a jar file run on startup
  1. Create the start and stop scripts of your application.
  • Example:

myapp-start.sh

#!/bin/bash
cd /home/ubuntu/myapp/
java -jar myapp.jar --server.port=8888 &