Skip to content

Instantly share code, notes, and snippets.

@cerealskill
cerealskill / install_az_cli20.sh
Created March 31, 2017 15:50
Install Azure CLI 2.0
pip install --user azure-cli
@cerealskill
cerealskill / make_partition.sh
Last active April 11, 2017 14:52
Crear particion a partir de un disco nuevo atachado
#!/bin/bash
fdisk /dev/sdb
# m – print help
# p – print the partition table
# n – create a new partition
# d – delete a partition
# q – quit without saving changes
# w – write the new partition table and exit
mkfs.ext4 /dev/sdb1
@cerealskill
cerealskill / postfix_admin_tools.txt
Last active April 23, 2024 00:30
Postfix Admin Tools - Comandos para administración de POSTFIX
# Deleting mail from MAIL-DAEMON in queue
for i in `mailq | grep MAILER-DAEMON | cut -f 1 -d " "`; do postsuper -d $i ; done
# So you get the number of all active mails with the command:
postqueue -p | egrep -c "^[0-9A-F]{10}[*]"
# and the number of all deferred mail with:
postqueue -p | egrep -c "^[0-9A-F]{10}[^*]"
# muestra cola
@cerealskill
cerealskill / zabbix_install_centos_6.sh
Last active May 29, 2017 15:23
Zabbix Install Server on Centos 6.X
# yum install centos-release-scl
# yum install rh-php56-php rh-php56-php-bcmath rh-php56-php-gd rh-php56-php-ldap rh-php56-php-mbstring rh-php56-php-xml rh-php56-php-mysqlnd
# yum install http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/zabbix-release-3.2-1.el6.noarch.rpm
# yum install zabbix-agent
# yum --enablerepo=zabbix-deprecated install zabbix-server-mysql
# yum --enablerepo=zabbix-deprecated install zabbix-web-mysql
# yum install mysql-server
# vi /etc/my.cnf
# service mysqld start
# chkconfig mysqld on
#!/bin/sh
N=1
while [ $N -lt 254 ]
do
ping 10.80.0.$N -c 1
COUNTER=$(( $N + 1 ))
done
@cerealskill
cerealskill / ionic_create_app_template_base.sh
Last active June 16, 2017 05:09
Ionic App (Plantilla Básica)
#!/bin/bash
# OG - 10-05-2017
# --------------------------------------------------------------
# Este comando; permite crea un proyecto desde 0 en Ionic
# tabs : a simple 3 tab layout
# sidemenu: a layout with a swipable menu on the side
# blank: a bare starter with a single page
# super: starter project with over 14 ready to use page designs
# tutorial: a guided starter project
@cerealskill
cerealskill / silver_google_maps.json
Created May 18, 2017 18:05
Google Maps (Silver) Style
/* Estilo Silver Para Mapa */
[
{
elementType: 'geometry',
stylers: [{color: '#f5f5f5'}]
},
{
elementType: 'labels.icon',
stylers: [{visibility: 'off'}]
},
@cerealskill
cerealskill / night_google_maps.json
Created May 18, 2017 18:06
Night Google Maps Style
[
{elementType: 'geometry', stylers: [{color: '#242f3e'}]},
{elementType: 'labels.text.stroke', stylers: [{color: '#242f3e'}]},
{elementType: 'labels.text.fill', stylers: [{color: '#746855'}]},
{
featureType: 'administrative.locality',
elementType: 'labels.text.fill',
stylers: [{color: '#d59563'}]
},
{
@cerealskill
cerealskill / change_timezona_CL.sh
Created May 22, 2017 16:17
Cambio de Hora (Linux Machine)
[root@QAFUSE01 ~]# zdump -v /usr/share/zoneinfo/America/Santiago | grep 2017
/usr/share/zoneinfo/America/Santiago Sun May 14 02:59:59 2017 UTC = Sat May 13 23:59:59 2017 CLST isdst=1 gmtoff=-10800
/usr/share/zoneinfo/America/Santiago Sun May 14 03:00:00 2017 UTC = Sat May 13 23:00:00 2017 CLT isdst=0 gmtoff=-14400
/usr/share/zoneinfo/America/Santiago Sun Aug 13 03:59:59 2017 UTC = Sat Aug 12 23:59:59 2017 CLT isdst=0 gmtoff=-14400
/usr/share/zoneinfo/America/Santiago Sun Aug 13 04:00:00 2017 UTC = Sun Aug 13 01:00:00 2017 CLST isdst=1 gmtoff=-10800
@cerealskill
cerealskill / firewall_rules_start.sh
Created May 29, 2017 15:52
Firewall Iptables CentOS 6.x (Script de inicio)
#!/bin/bash
# Open port 53 on firewall (iptables) Only for CentOS 6.X
sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A INPUT -p icmp -j ACCEPT # (Ping)
sudo iptables -A INPUT -i lo -j ACCEPT # (localhost)
sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT # SSH-Acceso
sudo iptables -I INPUT -p tcp -m tcp --dport 53 -j ACCEPT # DNS