Skip to content

Instantly share code, notes, and snippets.

@Mugila
Mugila / ubuntu-16-vps-lamp.sh
Created March 1, 2018 10:14 — forked from vaibhavpandeyvpz/ubuntu-16-vps-lamp.sh
Install and setup LAMP stack + Composer on a clean Ubuntu 16.04 VPS
#!/usr/bin/env bash
APACHE_USER=wwwhost
VHOSTS_DOMAINS=(example.com second.example.com)
sudo ufw allow in "OpenSSH"
# Install Apache
sudo apt-get update
sudo apt-get install apache2
sudo nano /etc/apache2/apache2.conf # Add ServerName ... directive at bottom
@Mugila
Mugila / nslookup loops
Created November 22, 2017 14:08 — forked from gfoss/nslookup loops
Basic nslookup loops for Windows and Linux
*****WINDOWS*****
//nslookup - subnet range
c:\>for /L %i in (1,1,255) do @nslookup 10.10.10.%i [server to resolve from] 2>nul | find "Name" && echo 10.10.10.%i && @echo [ctrl+g]
//nslookup - file of ip's
NAME c:\>for /F %i in ([file.txt]) do @nslookup %i [server to resolve from] 2>nul | find "Name" && echo %i
ADDRESS c:\>for /F %i in ([file.txt]) do @nslookup %i [server to resolve from] 2>nul | find "Address" && echo %i
Or just run c:\>nslookup and paste in the list
function Get-ProductKey {
<#
.SYNOPSIS
Retrieves the product key and OS information from a local or remote system/s.
.DESCRIPTION
Retrieves the product key and OS information from a local or remote system/s. Queries of 64bit OS from a 32bit OS will result in
inaccurate data being returned for the Product Key. You must query a 64bit OS from a system running a 64bit OS.
.PARAMETER Computername
@Mugila
Mugila / virtualbox-centos-cleanup.sh
Created January 29, 2017 22:07
Cleanup VirtualBox/CentOS
#!/bin/bash
function green {
echo -e "\e[32m${1}\e[0m"
}
green 'Removing old kernels...'
yum install yum-utils -y
package-cleanup --oldkernel --count=2
@Mugila
Mugila / installation.sh
Created January 29, 2017 21:22 — forked from virtualadrian/installation.sh
CentOS 7.0 Installation script (nginx, php-fpm, redis, postgresql), mainly for laravel
#!/bin/bash
#================#
# For CentOS 7.0 #
#================#
######## CONFIG ##########
user="user"
router="index.php"
@Mugila
Mugila / onchange.sh
Created January 29, 2017 21:15
Watch current directory and execute a command if anything in it changes
#!/bin/bash
#
# Watch current directory (recursively) for file changes, and execute
# a command when a file or directory is created, modified or deleted.
#
# Written by: Senko Rasic <senko.rasic@dobarkod.hr>
#
# Requires Linux, bash and inotifywait (from inotify-tools package).
#
# To avoid executing the command multiple times when a sequence of
@Mugila
Mugila / free-software-licenses.csv
Created January 29, 2017 20:59 — forked from turicas/free-software-licenses.csv
Download list of free software licenses from GNU page
name short_name url
GNU General Public License (GPL) version 3 GNUGPLv3 https://www.gnu.org/licenses/gpl.html
GNU General Public License (GPL) version 2 GPLv2 https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
GNU Lesser General Public License (LGPL) version 3 LGPLv3 https://www.gnu.org/licenses/lgpl.html
GNU Lesser General Public License (LGPL) version 2.1 LGPLv2.1 https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
GNU Affero General Public License (AGPL) version 3 AGPLv3.0 https://www.gnu.org/licenses/agpl.html
GNU All-Permissive License GNUAllPermissive https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html
Apache License, Version 2.0 apache2 http://directory.fsf.org/wiki/License:Apache2.0
Artistic License 2.0 ArtisticLicense2 http://directory.fsf.org/wiki/License:ArtisticLicense2.0
Clarified Artistic License ClarifiedArtisticLicense http://gianluca.dellavedova.org/2011/01/03/clarified-artistic-license/
@Mugila
Mugila / ec2_group_project.yml
Created January 29, 2017 20:30 — forked from carlessanagustin/ec2_group_project.yml
ANSIBLE: Change AWS EC2 Security Group configuration.
#!/usr/local/bin/ansible-playbook -v
---
- hosts: localhost
gather_facts: False
connection: local
vars:
rule_list:
- { proto: tcp, from_port: 80, to_port: up, cidr_ip: 10.0.0.1/32 }
- { proto: tcp, from_port: 443, to_port: 443, cidr_ip: 10.0.0.1/32 }
@Mugila
Mugila / old.yml
Created January 29, 2017 20:28 — forked from DanyC97/old.yml
ansible - example of looping yum packages with different setting for one of them
- name: Install the required rpms
yum: name={{ item }} state=latest
with_items:
- wget
- git
- net-tools
- bind-utils
- iptables-services
- bridge-utils
- bash-completion
@Mugila
Mugila / coreos-beta-cluster.yml
Created January 29, 2017 20:25 — forked from aburan28/coreos-beta-cluster.yml
Launching a CoreOS beta cluster on AWS using CloudFormation
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "CoreOS on EC2: http://coreos.com/docs/running-coreos/cloud-providers/ec2/",
"Mappings" : {
"RegionMap" : {
"eu-central-1" : {
"AMI" : "ami-573ef338"
},