Skip to main content
Advanced Search
Search Terms
Content Type

Exact Matches
Tag Searches
Date Options
Updated after
Updated before
Created after
Created before

Search Results

99 total results found

DB's and Users

Linux MySQL

Create a DB CREATE DATABASE new_database; Drop a DB DROP DATABASE new_database; Create a new user with all prems CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password'; GRANT [type of permission] ON [database name].[table name] TO ‘[username]’@'local...

Innodb recovery

Linux MySQL

What we will need to do for the recovery is to stop mysql and put it in innodb_force_recovery to attempt to backup all databases. service mysqld stop mkdir /root/mysqlbak cp -rp /var/lib/mysql/ib* /root/mysqlbak vim /etc/my.cnf You can start from 1 to 4, ...

MySQL Replication

Linux MySQL

*** TESTED FOR CENTOS 7 *** NEED TO HAVE PORT 3306 OPENED! -- MASTER = 10.1.2.117, SLAVE = 10.1.2.118 Master: vi /etc/my.cnf [mysqld]bind-address = 10.1.2.117server-id = 1log_bin = /var/lib/mysql/mysql-bin.logbinlog-do-db=mydbdatadir=/var/lib/mysqlsocket=/...

Regular expressions

Linux

SED Character Description ^ Matches the beginning of the line $ Matches the end of the line . Matches any single character * Will match zero or more occurrences of the previous character [ ] Matches all the characters inside the [ ] ...

Linux Routing

Networking

Routing View routes ip route ip route Adding a route ip addr add 192.168.1.100/24 dev eth0 Add a gateway ip route add default via 192.168.1.1 dev eth0 Add a route of a subnet to a gateway ip route add 10.1.2.0/24 via 10.1.2.1 dev eth0 null route (bla...

SSL .htaccess

Other

WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # BEGIN WordPress RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f Rewri...

rdiff-backup

Linux

#!/bin/bash SERVEURS="HOSTNAME.SEVER.COM 127.0.0.1" RDIFFEXCLUSIONS="--exclude /mnt --exclude /media --exclude /proc --exclude /dev --exclude /sys --exclude /var/lib/lxcfs --exclude-sockets" RDIFFOPTS="--print-statistics" DATE=`date +%Y-%m-%d` echo ...

Docker

Linux

Docker hub https://hub.docker.com/ Searching an Image docker search <img-name> Pull a Image docker pull <image>:<version> Run a Container docker run -it <img-name> /bin/bash Run a Container with ports + volume -v = volume, -p =...

Juniper Cli

Networking

Display Show Display configuration show configuration | display set Show display detail configuration show configuration | display detail show arp macs show ethernet-switching table File To navigate the file system you can do file list /? Backup Bac...

Firewall iptables script

Linux Firewall

# Interfaces WAN="ens3" LAN="ens9" #ifconfig $LAN up #ifconfig $LAN 192.168.1.1 netmask 255.255.255.0 echo 1 > /proc/sys/net/ipv4/ip_forward sysctl -w net.ipv4.ip_forward=1 iptables -F iptables -t nat -F iptables -t mangle -F iptables -X ...

named

Linux

/etc/named.conf options { listen-on port 53 { any; }; listen-on-v6 { none; }; directory "/var/named"; dump-file "/var/named/data/cache_dump.db"; statistics-file "/var/named/data/named_stats....

cPanel Notes

Linux cPanel

Useful scripts Restart ssh from URL http://11.22.33.44:2086/scripts2/doautofixer?autofix=safesshrestart To setup nat The /var/cpanel/cpnat file acts as a flag file for NAT mode. If the installer mistakenly detects a NAT-configured network, delete the/v...

Ansible

Linux

This Wiki page is a list of examples based of this project i created, for the full project details go to the link below http://git.myhypervisor.ca/dave/grafana_ansible Directory Structure playbook ├── ansible.cfg ├── playbook-example.yml ├── group_vars ...

Adding Adapter on vSwitch

Windows Hyper-V

List Adapter Get-VMNetworkAdapterVlan -ManagementOS Adding Adapter Add-VMNetworkAdapter -ManagementOS -Name "Lan" -SwitchName "vSwitch" Add-VMNetworkAdapter -ManagementOS -Name "Wan" -SwitchName "vSwitch" Tagging vlan on Adapter Set-VMNetworkAdapterVlan...

Git

Linux

Tags git tag -a v0.1 -m "tagname"git tag v0.1Deletegit tag -d v0.1 Branch Create branchgit branch stageCheck what branch you are ingit statusgit log --oneline --decorategit branch -aSwitch branches or restore working tree files.git checkout stagepush change...

OpenSSL

Linux

Check SSL On domain openssl s_client -connect www.domain.com:443 Check a Certificate Signing Request (CSR) openssl req -text -noout -verify -in CSR.csr Check a private key openssl rsa -in privateKey.key -check Check a certificate (crt or pem) openssl x...

Site-to-Site OpenVPN with routes

Linux

Install https://github.com/angristan/openvpn-install First, get the script and make it executable : curl -O https://raw.githubusercontent.com/Angristan/openvpn-install/master/openvpn-install.sh chmod +x openvpn-install.sh Then run it : ./openvpn-in...

LVM

Linux

LVM functions by layering abstractions on top of physical storage devices. The basic layers that LVM uses, starting with the most primitive, are. Physical Volumes: Description: Physical block devices or other disk-like devices (for example, other devices c...

Adding a LVM Cinder Volume

OpenStack

  mkfs.ext /dev/md0 mkdir /cinder-vol mount /dev/md0 /cinder-volumes dd if=/dev/zero of=/cinder-vol/cinder-vol bs=1 count=0 seek=3950G losetup /dev/loop2 /cinder-vol/cinder-vol pvcreate /dev/loop2 vgcreate cinder-vol /dev/loop2 Double check your work w...

AVMA - Hyper-V Automatic Virtual Machine Activation

Windows Hyper-V

Open CMD/Powershell slui 3 Guest Operating System Key Windows Server 2012 R2 Essentials K2XGM-NMBT3-2R6Q8-WF2FK-P36R2 Windows Server 2012 R2 Standard DBGBW-NPF86-BJVTX-K3WKJ-MTB6V Windows Server 2012 R2 Datacenter Y4TGP-NPTV9-HTC2H-7...