Skip to content

Instantly share code, notes, and snippets.

@rraallvv
rraallvv / enable-cgroups-on-centos-7.md
Last active November 2, 2018 12:07
Enabling Cgroups on CentOS 7

Install packages to use Cgroups.

# yum -y install libcgroup libcgroup-tools
# systemctl start cgconfig 

systemctl enable cgconfig

@rraallvv
rraallvv / open-cloudflare_(firewalld).sh
Last active November 19, 2022 22:44
Open public ports to Cloudflare for Firewalld
#!/usr/bin/env bash
# Instructions:
#
# 1) Place this script in the /root/ directory, give it proper permissions.
# $ sudo chmod +x /root/open-cloudflare.sh
#
# 2) Open the cron job editor
# $ sudo crontab -e
#
@rraallvv
rraallvv / install-g++-4.9.2-in-cent-os-7.sh
Last active November 4, 2018 01:32
install g++ 4.9.2 in Cent OS 6.5?
#sudo yum install devtoolset-3-gcc -y
#sudo yum install devtoolset-3-gcc-c++ -y
#sudo yum install centos-release-scl -y
sudo yum install devtoolset-3-toolchain -y
# add the line below to ~/.bash_profile
PATH=/opt/rh/devtoolset-3/root/usr/bin/:$PATH
@rraallvv
rraallvv / fix-centos-nginx-error13.txt
Created October 27, 2018 17:05
Fix CentOS Nginx error 13: Permission denied
sudo restorecon -R -v /var/www
@rraallvv
rraallvv / how-to-open-close-port-on-centos.md
Last active October 30, 2018 12:42
How to open/close port on centOS

Open port on Cent OS 6 and earlier:

Step 1

nano /etc/sysconfig/selinux

Make sure the file has this configurations

SELINUX=disabled
@rraallvv
rraallvv / fakeswap.sh
Created October 21, 2018 17:34
Create Fake Swap in OpenVZ VPS
#!/bin/bash
SWAP="${1:-512}"
NEW="$[SWAP*1024]"; TEMP="${NEW//?/ }"; OLD="${TEMP:1}0"
umount /proc/meminfo 2> /dev/null
sed "/^Swap\(Total\|Free\):/s,$OLD,$NEW," /proc/meminfo > /etc/fake_meminfo
mount --bind /etc/fake_meminfo /proc/meminfo
@rraallvv
rraallvv / add-new-crypto-to-peatio.md
Created October 20, 2018 17:57 — forked from muhammednagy/add-new-crypto-to-peatio.md
Adding A New Cryptocurrency to Peatio

State: Draft
Based on the Peatio Stable branch


Coin Daemon

To the coin daemon's {coin}.conf file, include the -walletnotify command:

# Notify when receiving coins
@rraallvv
rraallvv / twitter-tip-bot.service
Created October 20, 2018 12:24
Twitter Tip Bot service
[Unit]
Description=Twitter Tip Bot daemon
After=network.target nimiqd.service
[Service]
Type=simple
User=myuser
Group=myuser
Environment="TWITTER_USERNAME=twitter_username"
@rraallvv
rraallvv / geth.service
Created October 20, 2018 12:01
Ethereum service
[Unit]
Description=The Ethereum Blockchain Command Line Interface
After=network.target
[Service]
User=deploy
Group=deploy
ExecStart=/usr/bin/geth --rpc --syncmode "light" --cache=512 --rpcport=8545 --rpcapi eth,personal,net,web3,db --datadir /home/deploy/.ethereum
[Install]
@rraallvv
rraallvv / bitcoin.conf
Created October 20, 2018 11:56
Bitcoin service
server=1
daemon=1
#debug=mempool
debug=rpc
# If run on the test network instead of the real bitcoin network
# testnet=1
# You must set rpcuser and rpcpassword to secure the JSON-RPC api
# Please make rpcpassword to something secure, `5gKAgrJv8CQr2CGUhjVbBFLSj29HnE6YGXvfykHJzS3k` for example.