Skip to content

Instantly share code, notes, and snippets.

View lmduc's full-sized avatar

Duc Le lmduc

View GitHub Profile
@lmduc
lmduc / sysstat
Created September 19, 2016 09:21
sysstat file
# The first element of the path is a directory where the debian-sa1
# script is located
PATH=/usr/lib/sysstat:/usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin
# Activity reports every 2 minutes everyday
*/2 * * * * root command -v debian-sa1 > /dev/null && debian-sa1 1 1
# Additional run at 23:59 to rotate the statistics file
59 23 * * * root command -v debian-sa1 > /dev/null && debian-sa1 60 2
#
# Default settings for /etc/init.d/sysstat, /etc/cron.d/sysstat
# and /etc/cron.daily/sysstat files
#
# Should sadc collect system activity informations? Valid values
# are "true" and "false". Please do not put other values, they
# will be overwritten by debconf!
ENABLED="true"
@lmduc
lmduc / install_es_2.4.2
Last active December 1, 2016 06:34
Install on Ubuntu 14.04
### Install Java 8
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
echo "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" | sudo debconf-set-selections
sudo apt-get install oracle-java8-installer -y
### Download and install the Public Signing Key
wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
### Setup Repository
set background=dark
if version > 580
hi clear
if exists("syntax_on")
syntax reset
endif
endif
set t_Co=256
let g:colors_name = "flattown"
import React, { Component } from 'react'
import config from './particles.json'
class Particlejs extends Component {
componentDidMount() {
let script = document.createElement('script')
script.onload = function() {
particlesJS.load('particlejs', config)
}
script.src = "https://cdn.jsdelivr.net/npm/[email protected]/particles.min.js"
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
return 0;
}
@lmduc
lmduc / sum_square.md
Created February 21, 2019 16:04
Concurrent sum square C++
#include <bits/stdc++.h>
#include <thread>
#include <atomic>

using namespace std;

int MODULO = 123456789;

#define ll long long

Ruby in a nut shell

String and symbol

String: 'hello world' or "hello world"

Symbol: :hello or :'hello world'

Differences:

@lmduc
lmduc / Today I read.md
Created April 14, 2019 08:09
A simple log of what I read everyday