This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| yum install tftp-server | |
| vi /etc/xinetd.d/tftp | |
| #Encontre a linha: | |
| disable = yes | |
| #Mude-a para: | |
| disable = no | |
| #Levante o serviço: | |
| /sbin/chkconfig tftp on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Primeiramente instale os seguintes pacotes necessários para o NFS | |
| yum -y install nfs-utils rpcbind | |
| #Verifique a configuração do arquivo /etc/hosts, ele deverá estar mais ou menos assim: | |
| 127.0.0.1 localhost.localdomain magrathea | |
| 192.168.0.100 magrathea | |
| #Modifique o arquivo /etc/hosts.denny para o seguinte conteudo | |
| portmap mountd nfsd statd lockd rquotad : ALL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| x=$(lsb_release -a | grep "Distributor ID:") | |
| if [ ${x:16:6} = "Ubuntu" ] || [ ${x:16:6} = "Debian" ]; then | |
| #Instalar a pyserial no ubuntu/debian | |
| echo "Ubuntu ou debian" | |
| apt-get install python-pyserial | |
| elif [ ${x:16:4} = "arch" ]; then | |
| #Instalar a pyserial no Arch Linux | |
| echo "Arch linux" | |
| pacman -S python-pyserial |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import serial | |
| ser=serial.Serial() | |
| ser.open() | |
| ser.write('test\n') | |
| ser.close() | |
| ser2=serial.Serial('/dev/ttyS0', 19200, timeout=10) | |
| info=ser2.readline() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import socket | |
| fd = socket.socket(socket.AF_PACKET, socket.SOCK_RAW) | |
| fd.bind(('eth0', 9999)) | |
| mac = fd.getsockname()[-1] | |
| print ':'.join(['%02x' % ord(n) for n in mac]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #Packages | |
| #python, freetds e pymssql | |
| distro=$(lsb_release -a | grep "Distributor ID:") | |
| if [ ${distro:16:6} = "Debian" ]; then | |
| #Install Debian packages | |
| echo "Debian" | |
| apt-get install python freetds-common | |
| apt-get install python-pymssql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| #-*- coding:utf-8 -*- | |
| ########################################### | |
| # mysqlbkp.py | |
| # Desc: backup script writting python to backup all MySQL databases. | |
| # Autor: Demetrius Albuquerque | |
| # email: [email protected] | |
| # versão: 0.1 data: 08/11/2012 | |
| ########################################### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| #-*- coding:utf-8 -*- | |
| ########################################### | |
| # xensnapshot.py | |
| # Desc: xenserver snapshots | |
| # Author: Demetrius Albuquerque | |
| # mail: [email protected] | |
| # version: 0.1 data: 02/01/2013 | |
| ########################################### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo su | |
| #1 - Instalacao básica do MySQL | |
| apt-get install mysql-server mysql-client | |
| #Informe uma senha para o usuário root do MySQL | |
| #Password - PASSWORD | |
| #2 - Instalar Lighttpd | |
| apt-get install lighttpd | |
| #As páginas do lighttp devem ficar no /var/www |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SHOW PROCESSLIST; | |
| +----+-------------+----------------------+---------------------+---------+-------+-------+------------------+ | |
| | Id | User | Host | db | Command | Time | State | Info | | |
| +----+-------------+----------------------+---------------------+---------+-------+-------+------------------+ | |
| | 12 | root | 192.168.1.1:52451 | NULL | Query | 0 | NULL | SHOW PROCESSLIST | | |
| +----+-------------+----------------------+---------------------+---------+-------+-------+------------------+ | |
| 8 rows in set (0.01 sec) | |
| SELECT LEFT(host, IF(LOCATE(':', host), LOCATE(':', host), LENGTH(host) + 1) - 1) AS | |
| host_short,GROUP_CONCAT(DISTINCT USER) AS users,COUNT(*) |