quarta-feira, 11 de junho de 2014

redefinindo a senha do MYSQL

verifiquei q nao tenha nenhum processo do mysql rodando...

sudo service mysqld stop
sudo kill -9 `ps ax | grep mysql | grep -v grep | awk '{print $1}'`

alterar o arquivo
/usr/share/mysql/mysql_security_commands.sql
com as novas senhas depois execute
sudo mysql_install_db --random-passwords
depois de finalizado execute e troque a senha, pode ser a mesma, só para reativar o usuario
inicie o serviço do mysqld
sudo service mysqld start
agora troque a senha senha com
sudo mysql_secure_installation

e pronto.

Trocar nome da interface de rede de P8p1 para ETH0

Primeiro, acrecente o parametro biosdevname=0 no grub.conf na linha de load do kernel:
title Fedora (2.6.40.4-5.fc15.x86_64)
 root (hd0,0)
 kernel /boot/vmlinuz-2.6.40.4-5.fc15.x86_64 ro root=/dev/md0 SYSFONT=latarcyrheb-sun16 KEYTABLE=us biosdevname=0 quiet LANG=en_US.UTF-8
 initrd /boot/initramfs-2.6.40.4-5.fc15.x86_64.img
Abra / Crie o arquivo /etc/udev/rules.d/70-persistent-net.rules e utilize o modelo abaixo para definir o nome da interface
Lembre-se de definir corretamente o mac address
# Be sure to put your MAC addresses in the fields below
# SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:11:22:33:44:10", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:11:22:33:44:11", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
depois basta criar um arquivo ifcfg-ethX em /etc/sysconfig/network-scripts/ lembrando de acertar o mac address, pode-se utilizar o anterior p8p1 como exemplo.
...
HWADDR=00:11:22:33:44:10
...
Reinicie a máquina e pronto.

quinta-feira, 15 de maio de 2014

Rastreando os ips visíveis aos dispositivos de rede

  • Rastreamento Geral
for i in $(ip route | grep -v default | awk '{print $1 "-" $3}'); \
do \
nmap -sP $(echo $i | cut -d \- -f 1) | grep 'Nmap scan' | awk '{print "\033[32m" $5 "\033[39m"}'; \
done | sort | uniq
  • Rastreamento por interface
for i in $(ip route | grep -v default | awk '{print $1 "-" $3}'); \
do \
echo "============================="; \
echo "Rastreando a rede $(echo $i | cut -d \- -f 2)"; \
nmap -sP $(echo $i | cut -d \- -f 1) | grep 'Nmap scan' | awk '{print "\033[32m" $5 "\033[39m"}'; \
done;
  • Rastramento por interface com portas
for i in $(ip route | grep -v default | awk '{print $1 "-" $3}'); \
do echo "============================="; \
echo "Rastreando a rede $(echo $i | cut -d \- -f 2)"; \
nmap $(echo $i | cut -d \- -f 1) | egrep -v 'Not shown' | \
awk '{if ($0 ~ /PORT/) print "\033[33m" $0 "\033[39m"; \
else if ($2 ~ /open/) print "\033[32m" $0 "\033[39m"; \
else if($2 ~ /closed/) print "\033[31m" $0 "\033[39m"; \
else print $0}'; \
done;

terça-feira, 29 de abril de 2014

Rastreando canais e frequencias das redes wifi proximas

  • Para rastrear as frequências e canais
sudo iwlist wlp2s0 scan | egrep "Frequency\:.*\(Channel" | sort | uniq -c | sort -nr ; iwgetid -c
  • Para ober informações das redes
sudo iwlist wlp2s0 scan | egrep "Frequency\:.*\(Channel|ESSID|Quality|Address"

quinta-feira, 17 de abril de 2014

quarta-feira, 26 de março de 2014

Instalar Skype de um repositório yum

Installing Skype from Repository

Edit: Here is the new version that works with Fedora 13. It installs the latest Skype from the Skype repository (apparently the Skype repo was outdated in the past, but now it contains the same version as on the Skype website).

First, create the skype.repo file in the /etc/yum.repos.d directory:
Code:
su -
cat <<EOF> /etc/yum.repos.d/skype.repo
[skype]
name=Skype Repository
baseurl=http://download.skype.com/linux/repos/fedora/updates/i586/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-skype
enabled=1
gpgcheck=0
EOF
exit
Second, install Skype with
Code:
sudo yum -y install skype
Third, one may have to install a few libraries that Skype needs. If you're interested, you can find out more about these libraries with ldd /usr/share/skype and with yum provides *..., but this is not required for installation. All you need to do is (got this from Krellan's post):
Code:
sudo yum -y install alsa-lib.i686 dbus-libs.i686 e2fsprogs-libs.i686 expat.i686 fontconfig.i686 freetype.i686 glib2.i686 glibc.i686 keyutils-libs.i686 krb5-libs.i686 libcap.i686 libgcc.i686 libICE.i686 libpng.i686 libselinux.i686 libSM.i686 libstdc++.i686 libX11.i686 libXau.i686 libxcb.i686 libXcursor.i686 libXdmcp.i686 libXext.i686 libXfixes.i686 libXi.i686 libXinerama.i686 libXrandr.i686 libXrender.i686 libXScrnSaver.i686 libXv.i686 openssl.i686 qt.i686 qt-x11.i686 zlib.i686
Note: I am aware that setting gpgcheck=0 is a solution that is not optimal. However, it seems that the Skype key that is available on gpg.mit.edu doesn't work with the Skype repo any more. If you happen to know how to deal with this in a better way (e.g. if you know where the current Skype key is), please post it and I will update this guide.


================================

Below is the old version for Fedora 10. It might still be of some value to some people.

First, get Skype's public key:
Code:
gpg --keyserver pgp.mit.edu --recv-keys 0xD66B746E
gpg -a -o RPM-GPG-KEY-skype --export 0xD66B746E
sudo rpm --import RPM-GPG-KEY-skype
rm RPM-GPG-KEY-skype
Second, create the skype.repo file in the /etc/yum.repos.d directory:
Code:
su -
cat <<EOF> /etc/yum.repos.d/skype.repo
[skype]
name=Skype Repository
baseurl=http://download.skype.com/linux/repos/fedora/updates/i586/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-skype
enabled=1
gpgcheck=1
EOF
exit
Third, finish off the installation with
Code:
sudo yum -y install skype
Fonte: http://forums.fedoraforum.org/showthread.php?t=229573