Skip to content

Instantly share code, notes, and snippets.

View hslee87's full-sized avatar

Hansu hslee87

View GitHub Profile
@hslee87
hslee87 / etc:netplan:50-cloud-init.yaml
Created June 7, 2019 08:32
Ubuntu 18 - Static IP Settings
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
#network:
# ethernets:
# enp0s3:
# dhcp4: true
# version: 2
@hslee87
hslee87 / geth.service
Last active June 7, 2019 08:33
Geth (Ethereum) service
# It is not recommended to modify this file in-place, because it will
# be overwritten during package upgrades. If you want to add further
# options or overwrite existing ones then use
# $ systemctl edit bitcoind.service
# See "man systemd.service" for details.
[Unit]
Description=Ethereum daemon
After=network.target
@hslee87
hslee87 / bitcoind.service
Created June 7, 2019 08:22
bitcoin system service
# It is not recommended to modify this file in-place, because it will
# be overwritten during package upgrades. If you want to add further
# options or overwrite existing ones then use
# $ systemctl edit bitcoind.service
# See "man systemd.service" for details.
# Note that almost all daemon options could be specified in
# /etc/bitcoin/bitcoin.conf
[Unit]
In php.ini
#
# session.sid_bits_per_character=4 --> must be 4 (0-9a-f)
# session.sid_length=26 --> must be 40
#
in Session.php
>
> OR ! preg_match('/^[0-9a-f]{40}$/', $_COOKIE[$this->_config['cookie_name']])
SELECT * INTO OUTFILE '/tmp/m_user.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM
(
select 'name', 'type', 'nullable',
'data_type',
'column_key', 'extra', 'comments'
UNION
# crontab -e
37 4 * * 1 /usr/local/sbin/certbot-auto renew --no-self-upgrade 2>&1 >> /var/log/le-renew.log
# sudo apt-get install tomcat7
# sudo vi /etc/default/tomcat7
JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true -Xmx512m -XX:MaxPermSize=256m -XX:+UseConcMarkSweepGC"
# sudo service tomcat7 restart
#-- For web admin
# sudo apt-get install tomcat7-admin
public class Calculator {
public int add(int a, int b) {
int result = a + b;
System.out.println("sum() result : " + result);
return result;
}
public void sub(int a, int b)
{
@hslee87
hslee87 / Name.java
Last active October 23, 2016 04:16
public class Name
{
private String myName = “Java”;
public String askName()
{
System.out.println(“My Name is : “ + myName);
return myName;
}
$(function() {
//Wait for Pinegrow to wake-up
$("body").one("pinegrow-ready", function(e, pinegrow) {
//Create new Pinegrow framework object
var f = new PgFramework("AdminLTE", "AdminLTE");
//This will prevent activating multiple versions of this framework being loaded
f.type = "AdminLTE";