Skip to content

Instantly share code, notes, and snippets.

View vietdien2005's full-sized avatar
🦉
Don't get too close, it's dark inside

Dam Viet vietdien2005

🦉
Don't get too close, it's dark inside
View GitHub Profile
@vietdien2005
vietdien2005 / upgrade.md
Last active August 21, 2017 14:01
Upgrade Python 2.6 to Python 2.7 on Centos 6.6

Upgrade Python 2.6 to Python 2.7 on Centos 6.6

  sudo yum update # Update yum
  sudo yum install centos-release-scl # Install SCL 
  sudo yum install python27 # Install Python 2.7

To use it, you essentially spawn another shell (or script) while enabling the newer version of Python:

@vietdien2005
vietdien2005 / stream.sh
Last active October 7, 2017 10:07
streaming with ffmpeg
VBR="2500k"
FPS="30"
QUAL="veryfast"
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2"
SOURCE="http://125.212.211.162:8080/live/super-sunday.m3u8"
SOURCEFB="https://video-hkg3-1.xx.fbcdn.net/hvideo-atn2/v/dash-md/267360413666075-854021.m4a"
KEY="agyz-6wy0-k429-8gqu"
#ffmpeg \
@vietdien2005
vietdien2005 / config.sh
Created October 7, 2017 10:07
Fix force gdm login screen to the primary monitor
sudo cp ~/.config/monitors.xml /var/lib/gdm3/.config/
@vietdien2005
vietdien2005 / mkgit-centos6.sh
Created December 28, 2017 02:33 — forked from eyecatchup/mkgit-centos6.sh
Bash script to install the latest Git version on CentOS 6.x.
#!/usr/bin/env bash
# Install the latest version of git on CentOS 6.x
# Install Required Packages
sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
sudo yum install gcc perl-ExtUtils-MakeMaker
# Uninstall old Git RPM
sudo yum remove git
@vietdien2005
vietdien2005 / system.conf
Created December 29, 2017 03:47
LEMP config monit
## Apache monitoring.
## Test the httpd service.
check process apache with pidfile /run/httpd/httpd.pid
group apache
start program = "/usr/bin/systemctl start httpd"
stop program = "/usr/bin/systemctl stop httpd"
restart program = "/usr/bin/systemctl restart httpd"
## Test port 80. Restart if the server is down.
if failed host localhost port 80 protocol http then restart
@vietdien2005
vietdien2005 / install.md
Last active August 24, 2024 07:52
install bfgminer with cpu mining on Ubuntu 16.04

Install

  sudo apt-get install bfgminer
  • Unfortunately the version was not up to date, and was not compiled for mining scrypt-based coins like Litecoin. Here is how I built BFGMiner with this support.

  • Install the dependencies:

  sudo apt-get install build-essential autoconf libtool libjansson-dev libcurl4-gnutls-dev libncurses5-dev libudev-dev libusb-1.0-0-dev yasm uthash-dev
@vietdien2005
vietdien2005 / install.md
Created December 31, 2017 01:34
install CPU Mining
  sudo apt-get install git libcurl4-openssl-dev build-essential libjansson-dev autotools-dev automake
  git clone https://github.com/hyc/cpuminer-multi
  cd cpuminer-multi
  ./autogen.sh
  CFLAGS="-march=native" ./configure
  sudo make
  sudo make install 
  sudo ./minerd -a cryptonight -o stratum+tcp://pool.minexmr.com:4444 -u <WALLET_ADDRESS_HERE> -p x -t 3
@vietdien2005
vietdien2005 / install.md
Last active December 7, 2024 10:42
Install Nagios + Nginx Centos 7
  • Install Dev Tools, PHP, Nginx
  sudo yum install nginx php php-fpm php-common gcc glibc glibc-common gd gd-devel make net-snmp unzip -y
  sudo yum groupinstall 'Development Tools' -y
  • Nginx – Nagios Configuration
  cd /etc/nginx/conf.d
  sudo vi nagios.conf
@vietdien2005
vietdien2005 / connect.sh
Last active June 21, 2022 00:03
Script Auto Reconnect OpenVPN
#!/bin/bash
read -p "Type name config file vpn: " name_file
function getStatus () {
ifconfig | grep $1 && return 1
return 0
}
while [[ 1 ]]; do
@vietdien2005
vietdien2005 / command.md
Last active June 1, 2018 10:28
encrypt variable inside config with travis command
  travis encrypt DOCKER_USER=<username> --add env.matrix
  travis encrypt DOCKER_PASS=<password> --add env.matrix