Skip to content

Instantly share code, notes, and snippets.

View binhqd's full-sized avatar

Binh Quan binhqd

  • Green Global IT Solutions
View GitHub Profile
@binhqd
binhqd / kill-process-netstat.sh
Created August 10, 2018 03:42
Kill process grep by netstat
netstat -ntpl | grep java | awk '{print $7}' | sed -E 's/([\d]+?)\/(.*)/\1/' | xargs kill -9

Fix: Lost folder in /var/run after reboot

Create new .conf file in /usr/lib/tmpfiles.d with following

d    /var/run/haproxy   0755 haproxy haproxy - -
@binhqd
binhqd / page-component.js
Last active May 28, 2018 03:53
Redux Server Side
import React from 'react';
import {MasterLayout} from 'components/layouts';
import {NewsDetail} from 'components/news';
import title from 'constants/TitlePages.js';
import { asyncConnect } from 'redux-connect';
import CONFIG from 'base/constants/config';
import {Articles} from 'api';
@asyncConnect([{
@binhqd
binhqd / remove-systemctl-service.sh
Created May 24, 2018 02:12
Remove systemctl service
sudo systemctl stop [servicename]
sudo systemctl disable [servicename]
#rm /etc/systemd/system/[servicename]
#rm /etc/systemd/system/[servicename] symlinks that might be related
sudo systemctl daemon-reload
sudo systemctl reset-failed
@binhqd
binhqd / INSTALL.md
Created May 17, 2018 01:58 — forked from arya-oss/INSTALL.md
Ubuntu 16.04 Developer Tools installation

Ubuntu 16.04 Developer Tools Installation

First things first !

sudo apt update
sudo apt upgrade

Standard Developer Tools

sudo apt-get install build-essential git
keytool -genkey -alias quangnam -keyalg RSA -keysize 2048 -keystore quangnam.jks -dname "CN=localhost,OU=Home,O=Home,L=SL,S=WS,C=LK" -storepass quangnam -keypass quangnam
@binhqd
binhqd / remove-java-ubuntu.sh
Last active April 17, 2018 04:04
Completely remove Java
# Remove all the Java related packages (Sun, Oracle, OpenJDK, IcedTea plugins, GIJ):
dpkg-query -W -f='${binary:Package}\n' | grep -E -e '^(ia32-)?(sun|oracle)-java' -e '^openjdk-' -e '^icedtea' -e '^(default|gcj)-j(re|dk)' -e '^gcj-(.*)-j(re|dk)' -e '^java-common' | xargs sudo apt-get -y remove
sudo apt-get -y autoremove
# Purge config files (careful. This command removed libsgutils2-2 and virtualbox config files too):
dpkg -l | grep ^rc | awk '{print($2)}' | xargs sudo apt-get -y purge
# Remove Java config and cache directory:
sudo bash -c 'ls -d /home/*/.java' | xargs sudo rm -rf
@binhqd
binhqd / firebase rules
Created April 16, 2018 04:22
Setup Firebase on React Native
service cloud.firestore {
match /databases/{database}/documents {
match /todos/{document=**} {
allow read, write: if true;
}
}
}
@binhqd
binhqd / image-fit-container.js
Created March 27, 2018 04:28
React Native image fit to container
<Image style={styles.bgContainer} resizeMode='cover' source={require('./img/bg.png')} />
const styles = StyleSheet.create({ bgContainer: { flex:1, width: null, height: null } });