tag:blogger.com,1999:blog-64108406389052186542024-03-08T16:45:27.088-05:00Angel ContentsFreeBSD, Android, Linux, tutorials, etc.AngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.comBlogger33125tag:blogger.com,1999:blog-6410840638905218654.post-10198860707918275842016-04-26T13:38:00.000-05:002019-10-24T15:56:51.704-05:00FreeBSD 10.3 RELEASE AMD64Introduccion:<br />
<br />
Instalar FreeBSD 10.3 RELEASE AMD64<br />
Se instalaran algunos paquetes binarios<br />
<br />
Requerimientos:<br />
<br />
* Conexion a Internet<br />
* Instalador de FreeBSD<br />
* Leer este tutorial<br />
<br />
El proceso:<br />
<br />
Iniciar el equipo desde el medio de instalacion<br />
<br />
FreeBSD Installer<br />
---------------------------------------------------------------------------------------------------<br />
<br />
Welcome<br />
Welcome to FreeBSD! Would you<br />
like to begin an installation<br />
or use the live CD?<br />
<br />
<span style="font-size: large;"><b><Install></b></span> < Shell > <Live CD><br />
<br />
Keymap Selection<br />
<br />
>>> Continue with default keymap<br />
<br />
<span style="font-size: large;"><b><Select></b></span> <Cancel><br />
<br />
Set Hostname<br />
<br />
freebsd.example.com<br />
<br />
<span style="font-size: large;"><b>< OK ></b></span><br />
<br />
Distribution Select<br />
<br />
[*] doc Additional documentation<br />
[ ] games Games (fortune, etc.)<br />
[ ] lib32 32-bit compatibility libraries<br />
[*] ports Ports tree<br />
[*] src System source code<br />
<br />
<span style="font-size: large;"><b>< OK ></b></span><br />
<br />
Partitioning<br />
<br />
Auto (UFS) Guide Disk Setup<br />
Manual Manul Disk Setup (experts)<br />
Shell Open a shell nd partition by hand<br />
<b>Auto (ZFS) Guided Root-on-ZFS</b><br />
<br />
<span style="font-size: large;"><b>< OK ></b></span><br />
<br />
ZFS Configuration<br />
<br />
<b>>>> Install Proceed with Installation</b><br />
T Pool Type/Disks: stripe: 0 disks<br />
- Rescan Devices *<br />
- Disk Info *<br />
N Pool Name zroot<br />
4 Force 4K Sectors? YES<br />
E Encrypt Disk? NO<br />
P Partition Scheme GPT (BIOS)<br />
S Swap Size 2g <- Este valor se puede cambiar RAM x 2 => 8g<br />
M Mirror Swap? NO<br />
W Encrypt Swap? NO<br />
<br />
<span style="font-size: large;"><b>< Select ></b></span><br />
<br />
ZFS Configuration<br />
<br />
Select Virtual Device type:<br />
<br />
<b>stripe Stripe - No Redundancy</b><br />
mirror Mirror - n-Way Mirroring<br />
raidz1 RAID-Z1 - Single Redundant RAID<br />
raidz2 RAID-Z2 - Double Redundant RAID<br />
raidz3 RAID-Z3 - Triple Redundant RAID<br />
<br />
<span style="font-size: large;"><b>< OK ></b></span><br />
<br />
ZFS Configuration<br />
<br />
[*] xyz0 VirtIO Block Device <- Esto puede cambiar, use un disco virtual<br />
<br />
<span style="font-size: large;"><b>< OK ></b></span><br />
<br />
ZFS Configuration<br />
Last Change! Are you sure you want to destroy<br />
the current contents of the following disks:<br />
<br />
vtbd0<br />
<br />
<span style="font-size: large;"><b>< YES ></b></span><br />
<br />
Overall Progress:<br />
]]]]]]]]]]]]]]] 40%<br />
<br />
Please select a password for the system management account (root):<br />
Changing local password for root<br />
New Password: ********<br />
Retype New Password: ********<br />
<br />
Network Configuration<br />
Please select a network interface to<br />
configure:<br />
<br />
vtnet0 VirtIO Networking Adapter<br />
<br />
<span style="font-size: large;"><b>< OK ></b></span><br />
<br />
Network Configuration<br />
Would you like to<br />
configure IPv4 for this<br />
interface?<br />
<br />
<span style="font-size: large;"><b>< YES ></b></span><br />
<br />
Network Configuration<br />
Would you like to use<br />
DHCP to configure this<br />
interface?<br />
<br />
< YES > <span style="font-size: large;"><b>< NO ></b></span><br />
<br />
Network Configuration<br />
Static Network Interface Configuration<br />
<br />
IP Address 172.16.3.50 <- Ajuste estos parametros a su red<br />
Subnet Mask 255.255.0.0<br />
Default Router 172.16.1.1<br />
<br />
<span style="font-size: large;"><b>< OK ></b></span><br />
<br />
Network Configuration<br />
Would you like to<br />
configure IPv6 for this<br />
interface?<br />
<br />
<span style="font-size: large;"><b>< YES ></b></span> < NO ><br />
<br />
Network Configuration<br />
Would you like to try<br />
stateless address<br />
autoconfiguration<br />
(SLAAC)?<br />
<br />
< YES > <span style="font-size: large;"><b>< NO ></b></span><br />
<br />
Network Configuration<br />
Static IPv6 Network Interface Configuration<br />
<br />
IPv6 Address fc00::3:50/7<br />
Default Router fc00::1:1<br />
<br />
<span style="font-size: large;"><b>< OK ></b></span><br />
<br />
Network Configuration<br />
Resolver Configuration<br />
<br />
Search samdom.example.com<br />
IPv6 DNS #1 2001:4860:4860::8888<br />
IPv6 DNS #2 2001:4860:4860::8844<br />
IPv4 DNS #1 8.8.8.8<br />
IPv4 DNS #2 8.8.4.4<br />
<br />
<span style="font-size: large;"><b>< OK ></b></span><br />
<br />
Select local or UTC (Greenwich Mean Time) clock<br />
Is this machine's CMOS clock set to UTC? If it is to local time,<br />
or you don't know, please choose NO here!<br />
<br />
< YES > <span style="font-size: large;"><b>< NO ></b></span><br />
<br />
Time Zone Selector<br />
Select a region<br />
<br />
1 Africa<br />
<b>2 America -- North and South</b><br />
3 Antarctica<br />
4 Arctic Ocean<br />
5 Asia<br />
6 Atlantic Ocean<br />
7 Australia<br />
8 Europe<br />
9 Indian Ocean<br />
0 Pacific Ocean<br />
a UTC<br />
<br />
<span style="font-size: large;"><b>< OK ></b></span><br />
<br />
Countries in America -- North and South<br />
Select a country or region<br />
<br />
1 Anguilla<br />
2 Antigua and Barbuda<br />
3 Argentina<br />
4 Aruba<br />
5 Bahamas<br />
6 Barbados<br />
7 Belize<br />
8 Bolivia, Plurinational State of<br />
9 Bonaire, Sint Eustatius and Saba<br />
10 Brazil<br />
11 Canada<br />
12 Cayman Islands<br />
13 Chile<br />
<b>14 Colombia</b><br />
15 Costa Rica<br />
16 Cuba<br />
<br />
<span style="font-size: large;"><b>< OK ></b></span><br />
<br />
Confirmation<br />
Does the abbreviation `COT' look reasonable?<br />
<br />
<span style="font-size: large;"><b>< YES ></b></span><br />
<br />
System Configuration<br />
Choose the services you would like to be started at boot:<br />
<br />
[ ] local_unbound Local caching validating resolve<br />
[*] sshd Secure shell daemon<br />
[ ] moused PS/2 mouse pointer or console<br />
[ ] ntpd Synchronize system and network time<br />
[ ] powerd Adjust CPU frequency dynamically if supported<br />
[*] dumpdev Enable kernel crsh dumps to /var/crash<br />
<br />
<span style="font-size: large;"><b>< OK ></b></span><br />
<br />
Add User Accounts<br />
Would you like to add<br />
users to the installed<br />
system now?<br />
<br />
<span style="font-size: large;"><b>< YES ></b></span><br />
<br />
Add Users<br />
<br />
Username: jdoe<br />
Full name: John Doe<br />
Uid (Leave empty for default):<br />
Login group [jdoe]:<br />
Login group is jdoe. Invite jdoe into other groups? []:wheel<br />
Shell (sh csh tcsh nologin) [sh]:<br />
Home directory [/home/jdoe]:<br />
Home directory permissions (Leave empty for default):<br />
Use password-based authentication? [yes]:<br />
Use an empty password? (yes/no) [no]:<br />
Use a randon password? (yes/no) [no]:<br />
Enter password: ********<br />
Enter password again: ********<br />
Lock out the account after creation? [no]:<br />
Username : jdoe<br />
Password : ********<br />
Full Name : John Doe<br />
Uid : 1001<br />
Class :<br />
Groups : jdoe wheel<br />
Home : /home/jdoe<br />
Home Mode :<br />
Shell : /bin/sh<br />
Locked : no<br />
OK? (yes/no) : yes<br />
adduser: INFO : Successfully added (jdoe) to the user database.<br />
Add another user? (yes/no): no<br />
Goodbye!<br />
<br />
Final Configuration<br />
Setup of your FreeBSD system is nearly complete. You can now<br />
modify your configuration choices. After this screen, you will<br />
have an opportunity to make more complex changes using a shell.<br />
<br />
<b>Exit Apply configuration and exit installer</b><br />
Add User Add a user to the system<br />
Root Password Change root password<br />
Hostname Set system hostname<br />
Network Networking configuration<br />
Services Set daemons to run on startup<br />
Time Zone Set system timezone<br />
Handbook Install FreeBSD Handbook (requires network)<br />
<br />
<span style="font-size: large;"><b>< OK ></b></span><br />
<br />
Manual Configuration<br />
The installation is now finished.<br />
Before exiting the installer, would<br />
you like to open a shell in the new<br />
system to make any final manual<br />
modification?<br />
<br />
< YES > <span style="font-size: large;"><b>< NO ></b></span><br />
<br />
Complete<br />
Installation of FreeBSD<br />
complete! Would you like<br />
ro reboot into the<br />
installed system now?<br />
<br />
<span style="font-size: large;"><b><Reboot></b></span> <Live CD><br />
<br />
Actualizar los binarios de FreeBSD<br />
<br />
<b># freebsd-update fetch</b><br />
<br />
<b># freebsd-update install</b><br />
<br />
Instalar algunos paquetes binarios<br />
<br />
# <b>/usr/sbin/pkg</b><br />
The package management tool is not yet installed on your system.<br />
Do you want to fetch and install it now? [y/N]: <b>y</b><br />
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:10:amd64/quarterly, please wait...<br />
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done<br />
Installing pkg-1.7.2...<br />
Extracting pkg-1.7.2: 100%<br />
---<br />
For more information on available commands and options see 'pkg help'.<br />
<br />
# <b>pkg info pkg</b><br />
pkg-1.7.2<br />
---<br />
<br />
# <b>pkg update</b><br />
Updating FreeBSD repository catalogue...<br />
FreeBSD repository is up-to-date.<br />
All repositories are up-to-date.<br />
<br />
---------------------------------------------------------------------------------------------------------------<br />
Actualización 2016/12/14 Inicio<br />
<br />
El paquete binario de openntpd no esta disponible en este momento<br />
<br />
En su lugar activaremos el ntp que ya tiene FreeBSD, para activarlo<br />
<br />
<b># echo '# NTP' >> /etc/rc.conf</b><br />
<b># echo 'ntpd_enable="YES"' >> /etc/rc.conf</b><br />
<br />
Y omitiremos la parte referente al openntpd que siguen aqui abajo!<br />
<br />
# <b>pkg search openntpd</b><br />
openntpd-5.7p4_2,2 Network Time Protocol (NTP) daemon<br />
<br />
# <b>pkg install openntpd</b><br />
Updating FreeBSD repository catalogue...<br />
FreeBSD repository is up-to-date.<br />
All repositories are up-to-date.<br />
Updating database digests format: 100%<br />
The following 3 package(s) will be affected (of 0 checked):<br />
<br />
New packages to be INSTALLED:<br />
openntpd: 5.7p4_2,2<br />
libressl: 2.2.6<br />
ca_root_nss: 3.22.2<br />
<br />
The process will require 10 MiB more space.<br />
3 MiB to be downloaded.<br />
<br />
Proceed with this action? [y/N]: <b>y</b><br />
<br />
Fetching openntpd-5.7p4_2,2.txz: 100% 41 KiB 42.4kB/s 00:01 <br />
Fetching libressl-2.2.6.txz: 100% 2 MiB 1.2MB/s 00:02 <br />
Fetching ca_root_nss-3.22.2.txz: 100% 324 KiB 331.5kB/s 00:01 <br />
Checking integrity... done (0 conflicting)<br />
[1/3] Installing libressl-2.2.6...<br />
[1/3] Extracting libressl-2.2.6: 100%<br />
[2/3] Installing ca_root_nss-3.22.2...<br />
[2/3] Extracting ca_root_nss-3.22.2: 100%<br />
[3/3] Installing openntpd-5.7p4_2,2...<br />
<br />
Agregamos las tres lineas al archivo rc.conf para que inicie con el sistema<br />
<br />
# <b>echo '# OpenNTP' >> /etc/rc.conf</b><br />
# <b>echo 'openntpd_enable="YES"' >> /etc/rc.conf</b><br />
# <b>echo 'openntpd_flags="-sv"' >> /etc/rc.conf</b><br />
<br />
Verificamos que se agregaron las tres lineas al archivo rc.conf<br />
<br />
# <b>cat /etc/rc.conf | egrep "OpenNTP|openntpd"</b><br />
# OpenNTP<br />
openntpd_enable="YES"<br />
openntpd_flags="-sv"<br />
<br />
Iniciamos el servico<br />
<br />
# <b>/usr/local/etc/rc.d/openntpd start</b><br />
Starting openntpd.<br />
ntp_adjtime adjusted frequency by 0.000000ppm<br />
<br />
Actualización 2016/12/14 Fin<br />
---------------------------------------------------------------------------------------------------------------<br />
<br />
Nota:<br />
FreeBSD envia automaticamente reportes de estado al usuario root y solo los vemos si iniciamos localmente con este usuario, pero podemos hacer que estos reportes sean enviados a una cuenta en otro lugar, por ejemplo a nuestra cuenta en Gmail, para hacer esto debemos:<br />
<br />
# <b>edit /etc/mail/aliases</b><br />
<br />
Buscamos una linea que dice<br />
<br />
# root: me@my.domain<br />
<br />
Y luego de esa creamos una nueva con nuestro mail<br />
root: micorreo@gmail.com<br />
<br />
Guardamos los cambios en el editor y ejecutamos el comando<br />
<br />
# <b>cd /etc/mail && make</b><br />
<br />
Si root tiene un monton de correos, los podemos eliminar con<br />
<br />
# <b>cat /dev/null > /var/mail/root</b><br />
<br />
Comandos basicos de la utilidad pkg:<br />
<br />
Buscar un programa<br />
# <b>pkg search name</b><br />
<br />
Instalar un programa<br />
# <b>pkg install name</b><br />
<br />
Informacion de un programa instalado<br />
# <b>pkg info name</b><br />
<br />
Desinstalar un programa<br />
# <b>pkg delete name</b><br />
<br />
Actualizar todos los programas instalados<br />
# <b>pkg upgrade</b><br />
<br />
Ejemplo de pkg:<br />
<br />
# <b>pkg search nvidia-driver</b><br />
---<br />
nvidia-driver-346.96 NVidia graphics card binary drivers for hardware OpenGL rendering<br />
nvidia-driver-304-304.128 NVidia graphics card binary drivers for hardware OpenGL rendering<br />
nvidia-driver-340-340.93 NVidia graphics card binary drivers for hardware OpenGL rendering<br />
<br />
Como se puede ver hay varias versiones del driver de nvidia, para instalar una especificamente, la 340 en este caso<br />
<br />
# <b>pkg install nvidia-driver-340</b><br />
<br />
Luego para verificar el paquete instalado<br />
<br />
# <b>pkg info nvidia-driver-340</b><br />
nvidia-driver-340-340.93<br />
---<br />
<br />
Activar UTF-8 "Alternately, the superuser"<br />
<br />
Ver las localizaciones disponibles<br />
<br />
$ <b>locale -a | grep '\.UTF-8$'</b><br />
<br />
# <b>edit /etc/login.conf</b><br />
<br />
Modificar esta seccion de modo que quede asi:<br />
<br />
default:\<br />
:passwd_format=sha512:\<br />
:copyright=/etc/COPYRIGHT:\<br />
:welcome=/etc/motd:\<br />
:setenv=MAIL=/var/mail/$,BLOCKSIZE=K<span style="color: red;">,</span><span style="color: red;">LC_COLLATE=C</span>:\<br />
:path=/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin ~/bin:\<br />
:nologin=/var/run/nologin:\<br />
:cputime=unlimited:\<br />
:datasize=unlimited:\<br />
:stacksize=unlimited:\<br />
:memorylocked=64K:\<br />
:memoryuse=unlimited:\<br />
:filesize=unlimited:\<br />
:coredumpsize=unlimited:\<br />
:openfiles=unlimited:\<br />
:maxproc=unlimited:\<br />
:sbsize=unlimited:\<br />
:vmemoryuse=unlimited:\<br />
:swapuse=unlimited:\<br />
:pseudoterminals=unlimited:\<br />
:priority=0:\<br />
:ignoretime@:\<br />
:umask=022:<span style="color: red;">\</span><br />
<span style="color: red;">:charset=UTF-8:\</span><br />
<span style="color: red;">:lang=en_US.UTF-8:</span><br />
<br />
Aplicar los cambios <br />
<br />
# <b>cap_mkdb /etc/login.conf</b><br />
<br />
Especificamos el locale en este otro lugar tambien<br />
<br />
# <b>edit /etc/profile</b><br />
[...]<br />
LANG=en_US.UTF-8; export LANG<br />
CHARSET=UTF-8; export CHARSET<br />
<br />
El cambio a UTF-8 requiere reiniciar.<br />
<br />
Ver los logs del sistema<br />
<br />
# <b>cat /var/run/dmesg.boot</b><br />
# <b>cat /var/log/messages</b><br />
# <b>dmesg -a</b><br />
<br />
Ejemplo para desinstalar todos los pkg instalados<br />
<b><br /></b>
# <b>pkg delete -a</b><br />
<br />AngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com0tag:blogger.com,1999:blog-6410840638905218654.post-26871252020519002472015-10-05T13:16:00.002-05:002015-10-05T13:57:35.712-05:00NISIntroduccion:<br />
<br />
Instalar un Network Information System (NIS)<br />
<br />
Requerimientos:<br />
<br />
* FreeBSD instalado<br />
* Conexion a Internet<br />
* Leer este tutorial <br />
<br />
Manuales:<br />
<br />
https://www.freebsd.org/doc/handbook/network-nis.html<br />
http://daemon-notes.com/articles/network/unix-lan/nis<br />
http://blog.zespre.com/posts/2014/12/freebsd-nis-nfs<br />
<br />
Proceso: <br />
<br />
-------------------------------------------------------------------------------------------------------------------------------------<br />
NIS Master Server<br />
<br />
# cat /etc/rc.conf<br />
...<br />
# Network Information System (NIS)<br />
# NIS Master Server<br />
nisdomainname="samdom.dominio.com"<br />
nis_server_enable="YES"<br />
nis_yppasswdd_enable="YES"<br />
# A server that is also a client<br />
nis_client_enable="YES" # run client stuff as well<br />
nis_client_flags="-S samdom.dominio.com,alpha"<br />
<br />
# mkdir /var/yp/samdom.dominio.com<br />
<br />
# service ypserv start<br />
<br />
# cp /etc/master.passwd /var/yp/master.passwd<br />
# cd /var/yp <br />
# edit /var/yp/master.passwd<br />
<br />
Borro todos los usuarios especiales y solo dejo los que iniciaran en los equipos.<br />
<br />
# chmod 0600 /var/yp/master.passwd<br />
<br />
# ypinit -m samdom.dominio.com<br />
Server Type: MASTER Domain: samdom.dominio.com<br />
<br />
Creating an YP server will require that you answer a few questions.<br />
Questions will all be asked at the beginning of the procedure.<br />
<br />
Do you want this procedure to quit on non-fatal errors? [y/n: n] <br />
<br />
Ok, please remember to go back and redo manually whatever fails.<br />
If you don't, something might not work. <br />
<br />
Can we destroy the existing /var/yp/samdom.dominio.com and its contents? [y/n: n] y<br />
<br />
At this point, we have to construct a list of this domains YP servers.<br />
alpha.samdom.dominio.com is already known as master server.<br />
Please continue to add any slave servers, one per line. When you are<br />
done with the list, type a <control D>.<br />
master server : alpha.samdom.dominio.com<br />
next host to add: ^D<br />
The current list of NIS servers looks like this:<br />
<br />
alpha.samdom.dominio.com<br />
<br />
Is this correct? [y/n: y] y<br />
<br />
[..output from map generation..] <br />
<br />
NIS Map update completed.<br />
<br />
alpha.samdom.dominio.com has been setup as an YP master server without any errors.<br />
<br />
# adduser<br />
Username: jdoe<br />
Full name: John Doe<br />
Uid (Leave empty for default): <br />
Login group [jdoe]: <br />
Login group is jdoe. Invite jdoe into other groups? []: <br />
Login class [default]: <br />
Shell (sh csh tcsh nologin) [sh]: <br />
Home directory [/home/jdoe]: <br />
Home directory permissions (Leave empty for default): <br />
Use password-based authentication? [yes]: <br />
Use an empty password? (yes/no) [no]: <br />
Use a random password? (yes/no) [no]: <br />
Enter password: <br />
Enter password again: <br />
Lock out the account after creation? [no]: <br />
Username : jdoe<br />
Password : *****<br />
Full Name : John Doe<br />
Uid : 1002<br />
Class : <br />
Groups : jdoe <br />
Home : /home/jdoe<br />
Home Mode : <br />
Shell : /bin/sh<br />
Locked : no<br />
OK? (yes/no): yes<br />
adduser: INFO: Successfully added (jdoe) to the user database.<br />
Add another user? (yes/no): no<br />
Goodbye!<br />
<br />
# cd /var/yp<br />
<br />
# make samdom.dominio.com<br />
`samdom.dominio.com' is up to date.<br />
<br />
# cat /var/yp/securenets <br />
# allow connections from local host -- mandatory<br />
127.0.0.1 255.255.255.255<br />
# allow connections from my LAN<br />
# on the 192.168.128.0 network<br />
#192.168.128.0 255.255.255.0<br />
# on the 172.16.0.0 network<br />
172.16.0.0 255.255.0.0<br />
# allow connections from any host<br />
# between 10.0.0.0 to 10.0.15.255<br />
#10.0.0.0 255.255.240.0<br />
<br />
# shutdown -r now<br />
<br />
# dmesg -a<br />
...<br />
Setting NIS domain: samdom.dominio.com.<br />
Starting rpcbind.<br />
Starting ypserv.<br />
Starting ypbind.<br />
<br />
-------------------------------------------------------------------------------------------------------------------------------------<br />
NIS Slave Server<br />
<br />
# cat /etc/rc.conf<br />
...<br />
# Network Information System (NIS)<br />
# NIS Slave Server<br />
nisdomainname="samdom.dominio.com"<br />
nis_server_enable="YES"<br />
nis_yppasswdd_enable="YES"<br />
# A server that is also a client<br />
nis_client_enable="YES" # run client stuff as well<br />
nis_client_flags="-S samdom.dominio.com,alpha"<br />
<br />
# mkdir /var/yp/samdom.dominio.com<br />
<br />
# ypinit -s alpha samdom.dominio.com <br />
Server Type: SLAVE Domain: samdom.dominio.com Master: alpha<br />
<br />
Creating an YP server will require that you answer a few questions.<br />
Questions will all be asked at the beginning of the procedure.<br />
<br />
Do you want this procedure to quit on non-fatal errors? [y/n: n] n<br />
<br />
Ok, please remember to go back and redo manually whatever fails.<br />
If not, something might not work.<br />
There will be no further questions. The remainder of the procedure<br />
should take a few minutes, to copy the databases from alpha.<br />
Transferring netgroup...<br />
ypxfr: Exiting: Map successfully transferred<br />
Transferring netgroup.byuser...<br />
ypxfr: Exiting: Map successfully transferred<br />
Transferring netgroup.byhost...<br />
ypxfr: Exiting: Map successfully transferred<br />
Transferring master.passwd.byuid...<br />
ypxfr: Exiting: Map successfully transferred<br />
Transferring passwd.byuid...<br />
ypxfr: Exiting: Map successfully transferred<br />
Transferring passwd.byname...<br />
ypxfr: Exiting: Map successfully transferred<br />
Transferring group.bygid...<br />
ypxfr: Exiting: Map successfully transferred<br />
Transferring group.byname...<br />
ypxfr: Exiting: Map successfully transferred<br />
Transferring services.byname...<br />
ypxfr: Exiting: Map successfully transferred<br />
Transferring rpc.bynumber...<br />
ypxfr: Exiting: Map successfully transferred<br />
Transferring rpc.byname...<br />
ypxfr: Exiting: Map successfully transferred<br />
Transferring protocols.byname...<br />
ypxfr: Exiting: Map successfully transferred<br />
Transferring master.passwd.byname...<br />
ypxfr: Exiting: Map successfully transferred<br />
Transferring networks.byname...<br />
ypxfr: Exiting: Map successfully transferred<br />
Transferring networks.byaddr...<br />
ypxfr: Exiting: Map successfully transferred<br />
Transferring netid.byname...<br />
ypxfr: Exiting: Map successfully transferred<br />
Transferring hosts.byaddr...<br />
ypxfr: Exiting: Map successfully transferred<br />
Transferring protocols.bynumber...<br />
ypxfr: Exiting: Map successfully transferred<br />
Transferring ypservers...<br />
ypxfr: Exiting: Map successfully transferred<br />
Transferring hosts.byname...<br />
ypxfr: Exiting: Map successfully transferred<br />
<br />
bravo has been setup as an YP slave server without any errors.<br />
Remember to update map ypservers on alpha.<br />
<br />
-------------------------------------------------------------------------------------------------------------------------------------<br />
NIS Client<br />
<br />
# cat /etc/rc.conf<br />
...<br />
# Network Information System (NIS)<br />
# NIS Client<br />
nisdomainname="samdom.dominio.com"<br />
nis_client_enable="YES" # run client stuff as well<br />
nis_client_flags="-S samdom.dominio.com,alpha<br />
<br />
# /etc/netstart<br />
<br />
# service ypbind startAngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com0tag:blogger.com,1999:blog-6410840638905218654.post-71023242885234040152015-10-05T11:13:00.000-05:002015-10-26T08:32:29.875-05:00DDNS + DHCPdIntroduccion:<br />
<br />
Instalar un servidor DDNS que sera actualizado desde el servidor DHCPd.<br />
<br />
Requerimientos:<br />
<br />
* <a href="http://angelcontents.blogspot.com.co/2014/01/freebsd-100.html" target="_blank">FreeBSD instalado</a><br />
* Conexion a Internet<br />
* Leer este tutorial<br />
<br />
Proceso:<br />
(pendiente, pero los comandos y los archivos son validos para poner a funcionar todo)<br />
<br />
Comandos usados:<br />
<br />
# bsdconfig<br />
# passwd<br />
# freebsd-update fetch<br />
# freebsd-update install<br />
# portsnap fetch extract<br />
# portsnap fetch update<br />
# cd /usr/ports/dns/bind910<br />
# make config-recursive<br />
# make install clean<br />
# rndc-confgen -a<br />
wrote key file "/usr/local/etc/namedb/rndc.key"<br />
# cd /usr/ports/net/isc-dhcp43-server<br />
# make config-recursive<br />
# make install clean<br />
<br />
Por un tema de cambio de rutas en FreeBSD 8.2 y FreeBSD 10.2 creo un link simple<br />
# ln -s /usr/local/etc/namedb/ /etc/namedb<br />
<br />
Ajusto y/o creo los siguientes archivos<br />
<br />
------------------------------------------------------------------------------------------------------------------------------------<br />
# cat /etc/rc.conf<br />
<br />
hostname="alpha.samdom.dominio.com"<br />
<br />
# Servicio SSH<br />
sshd_enable="YES"<br />
<br />
# Primera tarjeta de red (INTERNET)<br />
ifconfig_em0="inet 192.168.16.22 netmask 255.255.240.0"<br />
defaultrouter="192.168.16.1"<br />
<br />
# Segunda tarjeta de red (LAN)<br />
ifconfig_em1="inet 172.16.100.1 netmask 255.255.0.0"<br />
<br />
# NTP<br />
ntpd_enable="YES"<br />
ntpd_config="/etc/ntp.conf"<br />
<br />
# ISC-DHCPd Server<br />
dhcpd_enable="YES"<br />
dhcpd_conf="/usr/local/etc/dhcpd.conf"<br />
dhcpd_ifaces="em1"<br />
<br />
# ISC BIND<br />
named_enable="YES"<br />
<br />
# Activamos OpenBSD Packet Filter (PF)<br />
pf_enable="YES" # Enable PF (load module if required)<br />
pf_rules="/etc/pf.conf" # rules definition file for pf<br />
pf_flags="" # additional flags for pfctl startup<br />
pflog_enable="YES" # start pflogd(8)<br />
pflog_logfile="/var/log/pflog" # where pflogd should store the logfile<br />
pflog_flags="" # additional flags for pflogd startup<br />
gateway_enable="YES" # Enable as LAN gateway (PF)<br />
<br />
# Network Information System (NIS)<br />
# NIS Master Server<br />
nisdomainname="samdom.dominio.com"<br />
nis_server_enable="YES"<br />
nis_yppasswdd_enable="YES"<br />
nis_client_enable="YES"<br />
nis_client_enable="YES" # run client stuff as well<br />
nis_client_flags="-S NIS domain,server"<br />
<br />
# IPv6<br />
#ipv6_activate_all_interfaces="YES"<br />
ifconfig_em1_ipv6="inet6 2001:0db8:1000:8b00::2 prefixlen 64"<br />
ipv6_defaultrouter="2001:0db8:1000:8b00::1"<br />
<br />
------------------------------------------------------------------------------------------------------------------------------------<br />
# cat /etc/ntp.conf<br />
<br />
# Associate to the public NTP pool servers<br />
server 0.pool.ntp.org prefer<br />
server 1.pool.ntp.org<br />
server 2.pool.ntp.org<br />
server 3.pool.ntp.org<br />
<br />
# Location of drift file<br />
driftfile /var/db/ntp.drift<br />
<br />
# Location of the log file<br />
logfile /var/log/ntpd<br />
<br />
# Restrictions<br />
restrict default kod nomodify notrap nopeer noquery<br />
restrict -6 default kod nomodify notrap nopeer noquery<br />
restrict 127.0.0.1<br />
restrict -6 ::1<br />
restrict 127.127.1.0 <br />
<br />
------------------------------------------------------------------------------------------------------------------------------------<br />
# cat resolv.conf<br />
<br />
# Generated by resolvconf<br />
#nameserver 192.168.16.1<br />
#nameserver 192.168.16.8<br />
<br />
# FreeBSD DNS<br />
search samdom.dominio.com<br />
#nameserver 2001:4860:4860::8888<br />
#nameserver 2001:4860:4860::8844<br />
#nameserver 8.8.8.8<br />
#nameserver 8.8.4.4<br />
nameserver 127.0.0.1<br />
<br />
------------------------------------------------------------------------------------------------------------------------------------<br />
# cat /usr/local/etc/namedb/named.conf<br />
<br />
<a href="https://drive.google.com/open?id=0B-ODrM4HjfLrQTZKNHFTQXdkWWM" target="_blank">Google Drive</a><br />
<br />
------------------------------------------------------------------------------------------------------------------------------------<br />
# cat /usr/local/etc/namedb/dynamic/samdom.dominio.com<br />
<br />
<a href="https://drive.google.com/open?id=0B-ODrM4HjfLrQTZKNHFTQXdkWWM" target="_blank">Google Drive</a><br />
<br />
------------------------------------------------------------------------------------------------------------------------------------<br />
# cat /usr/local/etc/namedb/dynamic/16.172.in-addr.arpa<br />
<br />
<a href="https://drive.google.com/open?id=0B-ODrM4HjfLrQTZKNHFTQXdkWWM" target="_blank">Google Drive</a><br />
<br />
------------------------------------------------------------------------------------------------------------------------------------<br />
# cat /usr/local/etc/dhcpd.conf<br />
<br />
<a href="https://drive.google.com/open?id=0B-ODrM4HjfLrQTZKNHFTQXdkWWM" target="_blank">Google Drive</a><br />
<br />
------------------------------------------------------------------------------------------------------------------------------------<br />
# cat /etc/pf.conf<br />
<br />
<a href="https://drive.google.com/open?id=0B-ODrM4HjfLrQTZKNHFTQXdkWWM" target="_blank">Google Drive</a><br />
<br />
------------------------------------------------------------------------------------------------------------------------------------<br />
# touch /var/log/ntpd <br />
# /usr/local/etc/rc.d/named start<br />
# /usr/local/etc/rc.d/isc-dhcpd start<br />
# shutdown -r now <br />
<br />
# rndc status<br />
version: BIND 9.9.8 (Extended Support Version) <id:2d6d4ba><br />
CPUs found: 1<br />
worker threads: 1<br />
UDP listeners per interface: 1<br />
number of zones: 163<br />
debug level: 0<br />
xfers running: 0<br />
xfers deferred: 0<br />
soa queries in progress: 0<br />
query logging is OFF<br />
recursive clients: 0/0/1000<br />
tcp clients: 0/100<br />
server is up and running<br />
<br />
Para poder editar mis archivos de zonas hay que congelarlos con:<br />
<br />
# rndc freeze samdom.dominio.com<br />
# rndc freeze 16.172.in-addr.arpa<br />
<br />
Luego de editarlos (recordar actualizar el serial "2015100101" de cada uno) descongelarlos con:<br />
<br />
# rndc thaw samdom.dominio.com<br />
# rndc thaw 16.172.in-addr.arpa<br />
<br />AngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com0tag:blogger.com,1999:blog-6410840638905218654.post-22360235347116611452015-02-06T17:25:00.000-05:002015-02-06T17:26:23.959-05:00Instalar fuentes en FreeBSDIntroduccion:<br />
<br />
Instalar fuentes adicionales en FreeBSD.<br />
<br />
Requerimientos:<br />
<br />
* <a href="http://angelcontents.blogspot.com/2014/01/freebsd-100.html" target="_blank">FreeBSD instalado</a><br />
* <a href="http://angelcontents.blogspot.com/2014/02/the-x-window-system.html" target="_blank">The X Window System instalado</a><br />
<br />
* Leer este tutorial<br />
<br />
El proceso:<br />
<br />
Type1 Fonts<br />
<br />
# cd /usr/ports/x11-fonts/urwfonts<br />
# make install clean<br />
<br />
# edit /etc/X11/xorg.conf<br />
<br />
Agregamos al final la linea FontPath "/usr/local/lib/X11/fonts/urwfonts/", se ve asi:<br />
<br />
Section "Files"<br />
ModulePath "/usr/local/lib/xorg/modules"<br />
...<br />
FontPath "/usr/local/lib/X11/fonts/75dpi/"<br />
FontPath "/usr/local/lib/X11/fonts/urwfonts/"<br />
<br />
<br />
Para cargar las nuevas fuentes sin reiniciar las X, ejecutamos desde la cuenta del usuario<br />
<br />
$ xset fp+ /usr/local/lib/X11/fonts/urwfonts<br />
$ xset fp rehash<br />
<br />
TrueType® Fonts<br />
<br />
# edit /etc/X11/xorg.conf<br />
<br />
Agregamos al final la linea FontPath "/usr/local/lib/X11/fonts/TrueType/", se ve asi:<br />
<br />
Section "Files"<br />
ModulePath "/usr/local/lib/xorg/modules"<br />
...<br />
FontPath "/usr/local/lib/X11/fonts/urwfonts/"<br />
FontPath "/usr/local/lib/X11/fonts/TrueType/"<br />
<br />
Agregamos al final la linea Load "freetype", se ve asi:<br />
<br />
Section "Module" <br />
...<br />
Load "dri2" <br />
Load "freetype"<br />
<br />
# mkdir /usr/local/lib/X11/fonts/TrueType<br />
<br />
# cd /usr/ports/x11-fonts/ttmkfdir<br />
# make install clean<br />
<br />
Copiar las fuentes al directorio /usr/local/lib/X11/fonts/TrueType<br />
<br />
# cp /usr/home/jdoe/*.ttf /usr/local/lib/X11/fonts/TrueType<br />
<br />
Luego las hacemos compatibles con FreeBSD<br />
<br />
# cd /usr/local/lib/X11/fonts/TrueType<br />
# ttmkfdir -o fonts.dir<br />
<br />
Para cargar las nuevas fuentes sin reiniciar las X, ejecutamos desde la cuenta del usuario<br />
<br />
$ xset fp+ /usr/local/lib/X11/fonts/TrueType<br />
$ xset fp rehash AngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com0tag:blogger.com,1999:blog-6410840638905218654.post-66003813250919282192014-12-01T15:28:00.005-05:002022-01-21T17:15:04.105-05:00Dispositivos USB<p>Introduccion:<br />
<br />
Montar memorias USB en FreeBSD<br />
El usuario root no tiene problemas para montar un dispositivo USB mediante el comando<br />
<br />
Ver el dispositivo detectado por el sistema<br />
# dmesg<br />
# camcontrol devlist<br />
<br />
Montar el dispositivo detectado<br />
# mount -t msdosfs -o -m=644,-M=755 /dev/da0s1 /mnt<br />
<br />
Este tutorial explica como permitir que los usuarios no-root puedan montar dispositivos USB.<br />
<br />
Requerimientos:<br />
<br />
* Acceso a root<br />
* Leer este tutorial<br />
<br />
Tutoriales:<br />
<br />
https://www.freebsd.org/doc/handbook/usb-disks.html<br />
http://www.codebuddies.de/2014/03/28/0x0b-howto-mount-a-extfat-filesystem-on-freebsd<br />
https://forums.freebsd.org/threads/mount-exfat-fuse-as-regular-user.46985<br />
http://olivier.cochard.me/bidouillage/installation-et-configuration-de-freebsd-comme-poste-de-travail<br />
http://blog.desdelinux.net/freebsd-que-hacer-despues-instalar<br />
https://forums.freebsd.org/threads/formatting-a-usb-stick.10986<br />
http://www.freebsdonline.com/content/view/890/524<br />
http://bsdgurl.net/text/formatting-external-disk-to-fat32.txt<br />
<br />
El proceso:<br />
<br />
Agregamos nuestro usuario john al grupo operator<br />
<br />
<br />
# pw groupmod operator -m john<br />
<br />
# edit /etc/devfs.rules<br />
<br />
# USB Storage Devices<br />
[localrules=5]<br />
add path 'da*' mode 0660 group operator<br />
<br />
# edit /etc/rc.conf<br />
<br />
# USB Storage Devices <br />
devfs_system_ruleset="localrules"<br />
<br />
# edit /etc/sysctl.conf<br />
<br />
# USB Storage Devices<br />
vfs.usermount=1<br />
<br />
# sysctl vfs.usermount=1<br />
</p><p></p><p></p><p></p><p># service devfs restart</p><p></p><p>
# mkdir /mnt/usb<br />
<br />
# chown john:john /mnt/usb<br />
<br />
# camcontrol devlist<br />
<Generic Flash Disk 5.00> at scbus10 target 0 lun 0 (da0,pass7)<br />
<br />
% ls /dev/da0*<br />
/dev/da0s1<br />
<br />
% mount -t msdosfs -o -m=644,-M=755 /dev/da0s1 /mnt/usb<br />
<br />
% umount /mnt/usb<br />
<br />
Para facilitar el montar y desmontar la memoria, se puede usar el siguiente scirpt:<br />
<br />
$ edit ~/Desktop/USB-Key.sh<br />
<br />
<span style="color: red;">#!/bin/sh</span><br />
<span style="color: red;"><br /></span>
<span style="color: red;">if [ "$(df -h | grep '/mnt/usb' | cut -d ' ' -f1)" != '/dev/da0s1' ]; then</span><br />
<span style="color: red;"> echo 'Montando memoria'</span><br />
<span style="color: red;"> mount -t msdosfs -o -m=644,-M=755 /dev/da0s1 /mnt/usb</span><br />
<span style="color: red;"> dolphin /mnt/usb > /dev/null 2>&1</span><br />
<span style="color: red;">else</span><br />
<span style="color: red;"> echo 'Desmontando memoria'</span><br />
<span style="color: red;"> killall dolphin </span><br />
<span style="color: red;"> umount /mnt/usb</span><br />
<span style="color: red;">fi</span><br />
<br />
Si necesitamos formatear el dispositivo USB (no debe estar montado)<br />
<br />
Then we clean the drive (remove previous partition):<br />
<br />
# dd if=/dev/zero of=/dev/da0 bs=1m<br />
<br />
Then we will create the slice:<br />
# fdisk -i da0<br />
<br />
Do you want to change our idea of what BIOS thinks ? [n] Press Enter<br />
Do you want to change it?[n] Press Enter<br />
Do you want to change it?[n] Press Enter<br />
Do you want to change it?[n] Press Enter<br />
Do you want to change it?[n] Press Enter<br />
Do you want to change the active partition? [n] Press Enter<br />
<br />
Should we write new partition table? [n] Press y<br />
<br />
Then we will create the FAT32 file system:<br />
<br />
# newfs_msdos -F32 /dev/da0s1</p>AngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com0tag:blogger.com,1999:blog-6410840638905218654.post-16081446590761649082014-06-20T09:28:00.000-05:002014-12-24T09:40:39.616-05:00LG Nexus 5 LG-D820 y LG-D821 Factory ImagesIntroduccion:<br />
<br />
En este tutorial se enseña a flashear nuestro equipo LG Nexus 5, para el modelo LG-D820 que se comercializa para USA y para el modelo LG-D821 que se comercializa para Europa, con las imagenes de fabrica que proporciona Google.<br />
<br />
Se pueden consultar las ultimas imagenes de fabrica en este lugar<br />
https://developers.google.com/android/nexus/images<br />
<br />
El proceso de flasheo no es complicado, pero requiere de unos conocimientos minimos para hacerlo, si usted no sabe que es un Terminal o si no tiene la paciencia para seguir este tutorial paso a paso, es mejor que pase de el y espere que la actualizacion le llegue mediante OTA (Over-The-Air) automaticamente en unas semanas.<br />
<br />
Flashear un Nexus 5 es relativamente seguro, pero nada en la vida sera 100% seguro, si usted sigue este manual es bajo su propio riesgo entendiendo que existe un minimo de peligro de dañar su querido Nexus y puede tener que enviarlo al centro de servicio si algo sale mal.<br />
<br />
Este proceso borrara todo el contenido de su Nexus 5, por favor haga una copia del contenido importante primero (fotos, contactos, etc.).<br />
<br />
Para nuestro tutorial usaremos un equipo de Apple MAC con OS X, las imagenes de fabrica tambien se pueden flashear en computadores con Windows, pero yo prefiero hacerlo en un MAC ya que es mas facil al no tener que descargar drivers y otras cosas.<br />
<br />
En este tutorial se uso la ultima version de la imagen de fabrica de Android 4.4.4, pero tambien se puede usar para versiones mas nuevas ajustando las rutas de descarga y los nombres de directorios.<br />
<br />
Todo el proceso se hara, como explico usando un MAC, mediante el Terminal, mi intencion es que usando el terminal usted simplemente debe copiar los comandos y pegarlos en el Terminal de su computador y dar enter, pero recuerde que si esta intentando usar este manual con una version superior de Android a la 4.4.4, debe actualizar los links y los nombres de los directorios.<br />
<br />
Requerimientos:<br />
<br />
* Un computador Apple con OS X.<br />
* Conexion a Internet.<br />
* Un Nexus 5 de cualquiera de los dos modelos existentes (LG-D820 o LG-D821).<br />
* El cable original USB de su equipo o uno compatible.<br />
<br />
Actualizado (2014/11/12) para Android <span style="background-color: white; color: #222222; font-family: Roboto, sans-serif; font-size: 14px; line-height: 22.399999618530273px;">5.0 (LRX21O)</span><br />
<div>
<span style="color: #222222; font-family: Roboto, sans-serif;"><span style="font-size: 14px; line-height: 22.399999618530273px;"><br /></span></span>
<b>Opcion 1. El proceso automatizado mediante un script:</b><br />
<br />
Para hacer el proceso de una forma mas facil, he creado un script que ejecuta los comandos paso a paso, pero esta en desarrollo en estos momentos, aqui lo puede descargar desde Google Drive -> <a href="https://drive.google.com/folderview?id=0B-ODrM4HjfLrZnV5ajYxWVdFazQ&usp=sharing" target="_blank">hammerhead.sh</a>, para usarlo lo debe descargar al escritorio de su computador, luego se va al Terminal que se encuentra en Finder / Applications / Utilities / Terminal.<br />
<br />
Debe ejecutar el script asi (ajuste el comando al nombre del script):<br />
$ chmod +x ~/Desktop/hammerhead.sh <br />
$ ~/Desktop/hammerhead.sh<br />
<br />
y seguir las instrucciones del script.<br />
<div>
<br /></div>
<div>
Script actualizado (2014/11/12) para Android <span style="background-color: white; color: #222222; font-family: Roboto, sans-serif; font-size: 14px; line-height: 22.3999996185303px;">5.0 (LRX21O)</span></div>
<div>
<b><br /></b></div>
<div>
<b>Opcion 2. El proceso manual paso a paso:</b><br />
<br />
Finder / Applications / Utilities / Terminal<br />
<br />
1) Entrar al directorio<br />
$ cd ~/Desktop<br />
<br />
2) Descargar el archivo de imagen <br />
<br /></div>
<div>
Para Android <span style="background-color: white; color: #222222; font-family: Roboto, sans-serif; font-size: 14px; line-height: 22.3999996185303px;">4.4.4 (KTU84P) use</span></div>
<div>
$ curl -o hammerhead.tgz https://dl.google.com/dl/android/aosp/hammerhead-ktu84p-factory-35ea0277.tgz</div>
<div>
<span style="font-family: sans-serif;"><br /></span></div>
<div>
<span style="font-family: sans-serif;">Para Android </span><span style="background-color: white; color: #222222; font-family: Roboto, sans-serif; font-size: 14px; line-height: 22.3999996185303px;">5.0 (LRX21O) use</span></div>
<div>
<span style="font-family: sans-serif;">$ curl -o hammerhead.tgz https</span>://dl.google.com/dl/android/aosp/hammerhead-lrx21o-factory-01315e08.tgz</div>
<div>
<br /></div>
<div>
3) Verificar el md5sun del archivo (comparelo con el de la web)<br />
$ md5 ~/Desktop/hammerhead.tgz<br />
<br />
4) Verificar el sha-1 del archivo (comparelo con el de la web)<br />
$ openssl sha1 ~/Desktop/hammerhead.tgz<br />
<br />
5) Descomprimir el archivo <br />
$ tar -xvzf ~/Desktop/hammerhead.tgz<br />
<br />
6) Cambiar el nombre del directorio</div>
<div>
<br /></div>
<div>
<span style="font-family: sans-serif;">Para Android </span><span style="background-color: white; color: #222222; font-family: Roboto, sans-serif; font-size: 14px; line-height: 22.3999996185303px;">4.4.4 (KTU84P) use</span></div>
<div>
$ mv hammerhead-ktu84p hammerhead<br />
<br />
<span style="font-family: sans-serif;">Para Android </span><span style="background-color: white; color: #222222; font-family: Roboto, sans-serif; font-size: 14px; line-height: 22.3999996185303px;">5.0 (LRX21O) use</span></div>
<div>
<span style="font-family: sans-serif;">$ mv hammerhead-</span><span style="font-family: sans-serif;">lrx21o </span><span style="font-family: sans-serif;">hammerhead</span></div>
<div>
<span style="font-family: sans-serif;"><br /></span></div>
<div>
7) Modificar flash-all.sh para incluir el path ~/Desktop/hammerhead/<br />
$ sed -i '' 's/fastboot/~\/Desktop\/hammerhead\/fastboot/g' ~/Desktop/hammerhead/flash-all.sh<br />
<br />
8) Descargar el fastboot que esta en el ADT Bundle<br />
$ curl -o adt-bundle-mac-x86_64.zip https://dl.google.com/android/adt/adt-bundle-mac-x86_64-20140702.zip<br />
<br />
9) Descomprimir el adt-bundle-mac-x86_64.zip<br />
$ unzip adt-bundle-mac-x86_64.zip<br />
<br />
10) Copiar el adb al directorio hammerhead<br />
$ cp ~/Desktop/adt-bundle-mac-x86_64-<span style="font-family: sans-serif;">20140702</span>/sdk/platform-tools/adb ~/Desktop/hammerhead<br />
<br />
<br />
11) Darle permisos de ejecucion al adb<br />
$ chmod +x ~/Desktop/hammerhead/adb<br />
<br />
12) Copiar fastboot al directorio hammerhead<br />
$ cp ~/Desktop/adt-bundle-mac-x86_64-<span style="font-family: sans-serif;">20140702</span>/sdk/platform-tools/fastboot ~/Desktop/hammerhead<br />
<br />
13) Darle permisos de ejecucion al fastboot<br />
$ chmod +x ~/Desktop/hammerhead/fastboot<br />
<br />
14) Conectar el Nexus 5 al Mac con el cable original USB o uno compatible <br />
<br />
15) Reiniciar el Nexus 5 en "FASTBOOT MODE"<br />
$ ~/Desktop/hammerhead/adb reboot bootloader<br />
<br />
Nota: <br />
Tambien se puede hacer manualmente al encender el Nexus 5 manteniendo presionadas las teclas Volumen abajo + Volumen arriba + boton encender simultaneamente.<br />
<br />
Veremos en rojo el titulo<br />
<br />
<b><span style="color: red;">FASTBOOT MODE</span></b><br />
...<br />
<b>LOCK STATE - locked</b> <- en color negro!<br />
<br />
16) Desbloquear el bootloader<br />
$ ~/Desktop/hammerhead/fastboot oem unlock<br />
<br />
En el terminal veremos algo como esto:<br />
...<br />
OKAY [101.578s]<br />
finished. total time: 101.578s <br />
<br />
Veremos un titulo Unlock bootloader?<br />
<br />
Para confirmar<br />
<br />
Volumen arriba + boton encender <br />
<br />
Luego de unos 10 segundos, veremos<br />
<br />
<b><span style="color: red;">LOCK STATE - unlocked</span></b> <- en color rojo!<br />
<br />
17) Entrar al directorio hamerhead<br />
$ cd ~/Desktop/hammerhead<br />
<br />
18) Ahora iniciamos la instalacion de la imagen de fabrica<br />
$ ~/Desktop/hammerhead/flash-all.sh<br />
<br />
En el terminal veremos algo como esto:<br />
<br />
sending 'bootloader' (2508 KB)...<br />
OKAY [ 0.187s]<br />
writing 'bootloader'...<br />
OKAY [ 0.474s]<br />
finished. total time: 0.661s<br />
rebooting into bootloader...<br />
OKAY [ 0.099s]<br />
finished. total time: 0.099s<br />
sending 'radio' (45409 KB)...<br />
OKAY [ 1.539s]<br />
writing 'radio'...<br />
OKAY [ 3.112s]<br />
finished. total time: 4.651s<br />
rebooting into bootloader...<br />
OKAY [ 0.092s]<br />
finished. total time: 0.092s<br />
archive does not contain 'boot.sig'<br />
archive does not contain 'recovery.sig'<br />
archive does not contain 'system.sig'<br />
--------------------------------------------<br />
Bootloader Version...: HHZ11k<br />
Baseband Version.....: M8974A-2.0.50.1.16<br />
Serial Number........: 06a9bccg002be57a<br />
--------------------------------------------<br />
checking product...<br />
OKAY [ 0.100s]<br />
checking version-bootloader...<br />
OKAY [ 0.100s]<br />
checking version-baseband...<br />
OKAY [ 0.100s]<br />
sending 'boot' (8700 KB)...<br />
OKAY [ 0.570s]<br />
writing 'boot'...<br />
OKAY [ 0.749s]<br />
sending 'recovery' (9284 KB)...<br />
OKAY [ 0.661s]<br />
writing 'recovery'...<br />
OKAY [ 0.779s]<br />
erasing 'system'...<br />
OKAY [ 1.292s]<br />
sending 'system' (721400 KB)...<br />
OKAY [ 22.793s]<br />
writing 'system'...<br />
OKAY [ 49.290s]<br />
erasing 'userdata'...<br />
OKAY [ 17.289s]<br />
formatting 'userdata' partition...<br />
Creating filesystem with parameters:<br />
Size: 29236371456<br />
Block size: 4096<br />
Blocks per group: 32768<br />
Inodes per group: 8192<br />
Inode size: 256<br />
Journal blocks: 32768<br />
Label: <br />
Blocks: 7137786<br />
Block groups: 218<br />
Reserved block group size: 1024<br />
Created filesystem with 11/1785856 inodes and 156120/7137786 blocks<br />
sending 'userdata' (139109 KB)...<br />
writing 'userdata'...<br />
OKAY [ 15.596s]<br />
erasing 'cache'...<br />
OKAY [ 0.638s]<br />
formatting 'cache' partition...<br />
Creating filesystem with parameters:<br />
Size: 734003200<br />
Block size: 4096<br />
Blocks per group: 32768<br />
Inodes per group: 7472<br />
Inode size: 256<br />
Journal blocks: 2800<br />
Label: <br />
Blocks: 179200<br />
Block groups: 6<br />
Reserved block group size: 47<br />
Created filesystem with 11/44832 inodes and 5813/179200 blocks<br />
sending 'cache' (13348 KB)...<br />
writing 'cache'...<br />
OKAY [ 2.196s]<br />
rebooting...<br />
<br />
finished. total time: 112.681s<br />
$<br />
<br />
Luego el Nexus 5 se reiniciara y veremos una barra azul de progreso<br />
<br />
El equipo se reiniciara y ya nos mostrara la ventana para poner el idioma y comenzar la configuracion de nuestra cuenta de Google, pero no continuaremos ya que hay que bloquear nuevamente el bootloader.<br />
<br />
19) Reiniciar el Nexus 5 en "FASTBOOT MODE" <br />
$ ~/hammerhead/adb reboot bootloader <br />
<br />
Veremos en rojo el titulo<br />
<br />
<span style="color: red;">FASTBOOT MODE</span><br />
...<br />
<b><span style="color: red;">LOCK STATE - unlocked</span></b> <- en color rojo!<br />
<br />
20) Bloquear el bootloader<br />
$ ~/Desktop/hammerhead/fastboot oem lock<br />
<br />
En el terminal veremos algo como esto:<br />
...<br />
OKAY [ 0.040s]<br />
finished. total time: 0.040s<br />
<br />
Veremos en rojo el texto<br />
<span style="color: red;">FASTBOOT MODE</span><br />
...<br />
<b>LOCK STATE - locked</b> <- en color negro!<br />
<br />
21) Reiniciamos normalmente el Nexus 5<br />
$ ~/hammerhead/adb reboot<br />
<br />
Ya podemos desconectar el Nexus 5 del computador y ya si configurar nuestra cuenta de Google.</div>
</div>
AngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com0tag:blogger.com,1999:blog-6410840638905218654.post-66785078789956526692014-03-20T13:05:00.000-05:002014-03-20T13:10:27.230-05:00WiresharkIntroduccion:<br />
<br />
Instalar el software Wireshark para hacer pruebas de monitoreo de trafico.<br />
<br />
Requerimientos:<br />
<br />
* FreeBSD instalado<br />
* The X Window System instalado<br />
* KDE instalado<br />
* Conexion a Internet<br />
* Leer este tutorial<br />
<br />
Manuales utilizados:<br />
<br />
https://forums.freebsd.org/viewtopic.php?&t=20109<br />
http://watchingthecloud.blogspot.com/2010/06/how-to-see-connections-in-wireshark.html<br />
http://wiki.wireshark.org/DisplayFilters<br />
<br />
El proceso:<br />
<br />
Agregar nuestro usuario no root al grupo wheel<br />
<br />
# edit /etc/group<br />
<br />
la linea original<br />
<br />
wheel:*:0:root<br />
<br />
queda asi<br />
<br />
wheel:*:0:root, jdoe<br />
<br />
Ahora debemos ajustar los permisos de /dev/bpf para que los usurios del grupo wheel puedan acceder<br />
<br />
# edit /etc/devfs.conf<br />
<br />
Al final agregamos las lineas<br />
<br />
# Wireshark<br />
own /dev/bpf* root:wheel<br />
perm /dev/bpf* 0640<br />
<br />
Reiniciamos devfs<br />
<br />
# /etc/rc.d/devfs restart<br />
<br />
Instalamos el port de wireshark<br />
<br />
# cd /usr/ports/net/wireshark<br />
# make install clean<br />
...<br />
Installing wireshark-1.10.6... done<br />
===> Cleaning for libsmi-0.4.8<br />
===> Cleaning for adns-1.4_1<br />
===> Cleaning for GeoIP-1.4.8_3<br />
===> Cleaning for wireshark-1.10.6<br />
<br />
Al terminar la instalacion, ya podemos iniciar wireshark desde el usuario jdoe y veremos las tarjetas en las que podemos hacer capturas.<br />
<br />
Si luego de usarlo, queremos desinstalarlo, ejecutamos<br />
<br />
# pkg delete libsmi-0.4.8 adns-1.4_1 GeoIP-1.4.8_3 wireshark-1.10.6<br />
<br />
Para saber como se usa, es bueno ver el siguiente link<br />
<br />
http://www.wireshark.org/docsAngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com0tag:blogger.com,1999:blog-6410840638905218654.post-2012760551059865602014-02-19T14:02:00.001-05:002014-02-19T14:11:39.000-05:00SFTPIntroduccion:<br />
<br />
Configurar el servicio SFTP para transferencias y que el usuario este enjaulado.<br />
<br />
Requerimientos:<br />
<br />
* FreeBSD instalado<br />
* Conexion a Internet<br />
* Leer este tutorial<br />
<br />
Manuales utilizados:<br />
<br />
<a href="http://freebsdrocks.net/index.php/guides-mainmenu-25/20-customizing-your-freebsd-box/108-chroot-scp-users-using-ssh" target="_blank">Chroot sftp users using ssh</a><br />
<br />
El proceso:<br />
<br />
# edit /etc/ssh/sshd_config<br />
<br />
Agragar al final las lineas:<br />
<br />
Match group chroot<br />
ChrootDirectory %u<br />
X11Forwarding no<br />
AllowTcpForwarding no<br />
ForceCommand internal-sftp<br />
<br />
Reiniciar (restart o reload) sshd<br />
<br />
# /etc/rc.d/sshd reload<br />
<br />
Agragar el nuevo grupo llamado chroot<br />
<br />
# pw addgroup chroot<br />
<br />
Nota:<br />
Para eliminar un grupo creado, usar: # pw groupdel nombregrupo<br />
<br />
Agregar el nuevo usuario con el que se conectaran<br />
<br />
# adduser<br />
Username: sftpuser<br />
Full name: SFTP User<br />
Uid (Leave empty for default):<br />
Login group [sftpuser]: chroot <- Atencion a este parametro!<br />
Login group is chroot. Invite sftpuser into other groups? []:<br />
Login class [default]:<br />
Shell (sh csh tcsh nologin) [sh]:<br />
Home directory [/home/sftpuser]: /home/sftpuser<br />
Home directory permissions (Leave empty for default):<br />
Use password-based authentication? [yes]:<br />
Use an empty password? (yes/no) [no]:<br />
Use a random password? (yes/no) [no]:<br />
Enter password:<br />
Enter password again:<br />
Lock out the account after creation? [no]:<br />
Username : sftpuser<br />
Password : *****<br />
Full Name : SFTP User<br />
Uid : 1170<br />
Class :<br />
Groups : chroot<br />
Home : /home/sftpuser<br />
Home Mode :<br />
Shell : /bin/sh<br />
Locked : no<br />
OK? (yes/no): yes<br />
adduser: INFO: Successfully added (sftpuser) to the user database.<br />
Add another user? (yes/no): no<br />
Goodbye!<br />
<br />
Ahora le ajustamos los permisos al home del usuario<br />
<br />
# chown -R root:chroot /home/sftpuser<br />
<br />
Crear un directorio llamado pub dentro para que puedan crear archivos<br />
<br />
# mkdir /home/sftpuser/pub<br />
<br />
Ajustarle los permisos al directorio pub<br />
<br />
# chmod -R 0777 /home/sftpuser/pub<br />
<br />
Los archivos se deben transferir al directorio pubAngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com0tag:blogger.com,1999:blog-6410840638905218654.post-34172060607943977602014-02-06T14:01:00.000-05:002014-10-24T07:41:10.283-05:00ISC BIND (DNS)Introduccion:<br />
<br />
Instalar ISC BIND.<br />
<br />
Requerimientos:<br />
<br />
* <a href="http://angelcontents.blogspot.com/2014/01/freebsd-100.html" target="_blank">FreeBSD instalado</a><br />
* Conexion a Internet<br />
* Leer este tutorial<br />
<br />
El proceso:<br />
<br />
Actualizar el arbol de ports<br />
<br />
# portsnap update<br />
<br />
Instalar el port de bind<br />
<br />
# cd /usr/ports/dns/bind99<br />
# make install clean<br />
<br />
bind99-9.9.5<br />
(dejo las opciones por defecto) <br />
...<br />
Installing bind99-9.9.5... done<br />
<br />
Hacer que inicie con el equipo<br />
<br />
# echo '# ISC BIND' >> /etc/rc.conf<br />
# echo 'named_enable="YES"' >> /etc/rc.conf<br />
<br />
Activar la tarjeta de red que va a nuestra LAN con la IP 192.168.1.1/24<br />
<br />
# edit /etc/rc.conf<br />
<br />
Agregamos la linea con los datos de nuestra segunda tarjeta de red<br />
<br />
#Segunda tarjeta de red que va hacia la LAN<br />
ifconfig_em1="inet 192.168.1.1 netmask 255.255.255.0"<br />
<br />
Levantamos manualmente la segunda tarjeta sin reiniciar<br />
<br />
# ifconfig em1 inet 192.168.1.1 netmask 255.255.255.0 up<br />
<br />
Editar el archivo de configuracion de bind para crear nuestras zonas<br />
<br />
# edit /usr/local/etc/namedb/named.conf<br />
<br />
Ajustamos las lineas originales<br />
<br />
...<br />
listen-on { 127.0.0.1; };<br />
...<br />
forwarders {<br />
127.0.0.1;<br />
};<br />
...<br />
zone "example.com" { type master; file "/etc/namedb/master/empty.db"; };<br />
...<br />
<br />
por<br />
<br />
...<br />
listen-on { 127.0.0.1; 192.168.1.1; };<br />
...<br />
forwarders {<br />
8.8.8.8;<br />
8.8.4.4;<br />
};<br />
...<br />
//zone "example.com" { type master; file "/etc/namedb/master/empty.db"; };<br />
...<br />
<br />
Note que:<br />
1) En listen-on se agrega la IP interna para que bind responda consultas que le hagan.<br />
2) En forwarders quitamos la IP local y agregamos las de los DNS de Google.<br />
3) Con doble slash (//) comentamos la linea zone "example.com"...<br />
<br />
Al final del archivo agregamos nuestras zonas "zona" y "zona inversa"<br />
<br />
...<br />
zone "example.com" {<br />
type master;<br />
allow-update { none; };<br />
allow-transfer { localhost; 192.168.1.2; };<br />
file "/usr/local/etc/namedb/master/example.com";<br />
};<br />
<br />
zone "1.168.192.in-addr.arpa" {<br />
type master;<br />
allow-update { none; };<br />
allow-transfer { localhost; 192.168.1.2; };<br />
file "/usr/local/etc/namedb/master/1.168.192.in-addr.arpa";<br />
};<br />
<br />
Creamos el archivo de nuestra "zona"<br />
<br />
# edit /usr/local/etc/namedb/master/example.com<br />
<br />
$TTL 3600 ; 1 hour default TTL<br />
example.com. IN SOA freebsd.example.com. admin.example.com. (<br />
2013021701 ; Serial<br />
10800 ; Refresh (3 hours)<br />
3600 ; Retry (1 hour)<br />
604800 ; Expire (1 week)<br />
300 ; Negative Response TTL (5 minutes)<br />
)<br />
; DNS Servers<br />
IN NS freebsd.example.com. <br />
; MX Records <br />
;IN MX 10 mx.example.com. <br />
;IN MX 20 mail.example.com. <br />
IN A 192.168.1.1 <br />
; Machine Names <br />
localhost IN A 127.0.0.1 <br />
freebsd IN A 192.168.1.1 <br />
; Aliases <br />
<br />
Creamos el archivo de nuestra "zona inversa"<br />
<br />
# edit /usr/local/etc/namedb/master/1.168.192.in-addr.arpa<br />
<br />
$TTL 3600 ; 1 hour default TTL<br />
1.168.192.in-addr.arpa. IN SOA freebsd.example.com. admin.example.com. (<br />
2013021701 ; Serial<br />
10800 ; Refresh (3 hours)<br />
3600 ; Retry (1 hour)<br />
604800 ; Expire (1 week)<br />
300 ; Negative Response TTL (5 minutes)<br />
)<br />
; DNS Servers <br />
IN NS freebsd.example.com. <br />
; Machine IPs <br />
1 IN PTR freebsd.example.com.<br />
<br />
Iniciamos bind<br />
<br />
# /usr/local/etc/rc.d/named start<br />
<br />
Hacer que nuestro FreeBSD use el bind<br />
<br />
# edit /etc/resolv.conf<br />
<br />
Comentamos las lineas "nameserver" y agregamos a bind, queda asi<br />
<br />
search example.com<br />
nameserver 2001:4860:4860::8888<br />
nameserver 2001:4860:4860::8844<br />
#nameserver 8.8.8.8<br />
#nameserver 8.8.4.4<br />
nameserver 127.0.0.1 <br />
<br />
Verificamos que bind esta funcionando<br />
<br />
Prueba a un host local<br />
<br />
# dig @192.168.1.1 freebsd.example.com<br />
<br />
; <<>> DiG 9.9.5 <<>> @192.168.1.1 freebsd.example.com<br />
; (1 server found)<br />
;; global options: +cmd<br />
;; Got answer:<br />
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36043<br />
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2<br />
<br />
;; OPT PSEUDOSECTION:<br />
; EDNS: version: 0, flags:; udp: 4096<br />
;; QUESTION SECTION:<br />
;freebsd.example.com. IN A<br />
<br />
;; ANSWER SECTION:<br />
freebsd.example.com. 3600 IN A 192.168.16.1<br />
<br />
;; AUTHORITY SECTION:<br />
freebsd.example.com. 3600 IN NS ns1.freebsd.example.com.<br />
freebsd.example.com. 3600 IN NS ns2.freebsd.example.com.<br />
<br />
;; ADDITIONAL SECTION:<br />
<br />
<br />
;; Query time: 0 msec<br />
;; SERVER: 192.168.1.1#53(192.168.1.1)<br />
;; WHEN: Thu Feb 06 13:40:35 COT 2014<br />
;; MSG SIZE rcvd: 118 <br />
<br />
Prueba a un host remoto <br />
<br />
# dig @192.168.1.1 google.com<br />
<br />
; <<>> DiG 9.9.5 <<>> @192.168.1.1 google.com<br />
; (1 server found)<br />
;; global options: +cmd<br />
;; Got answer:<br />
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48596<br />
;; flags: qr rd ra; QUERY: 1, ANSWER: 16, AUTHORITY: 4, ADDITIONAL: 5<br />
<br />
;; OPT PSEUDOSECTION:<br />
; EDNS: version: 0, flags:; udp: 4096<br />
;; QUESTION SECTION:<br />
;google.com. IN A<br />
<br />
;; ANSWER SECTION:<br />
google.com. 300 IN A 190.248.35.30<br />
google.com. 300 IN A 190.248.35.45<br />
google.com. 300 IN A 190.248.35.35<br />
google.com. 300 IN A 190.248.35.34<br />
google.com. 300 IN A 190.248.35.24<br />
google.com. 300 IN A 190.248.35.49<br />
google.com. 300 IN A 190.248.35.54<br />
google.com. 300 IN A 190.248.35.40<br />
google.com. 300 IN A 190.248.35.25<br />
google.com. 300 IN A 190.248.35.50<br />
google.com. 300 IN A 190.248.35.59<br />
google.com. 300 IN A 190.248.35.20<br />
google.com. 300 IN A 190.248.35.55<br />
google.com. 300 IN A 190.248.35.44<br />
google.com. 300 IN A 190.248.35.39<br />
google.com. 300 IN A 190.248.35.29<br />
<br />
;; AUTHORITY SECTION:<br />
google.com. 172742 IN NS ns4.google.com.<br />
google.com. 172742 IN NS ns1.google.com.<br />
google.com. 172742 IN NS ns3.google.com.<br />
google.com. 172742 IN NS ns2.google.com.<br />
<br />
;; ADDITIONAL SECTION:<br />
ns1.google.com. 172742 IN A 216.239.32.10<br />
ns2.google.com. 172742 IN A 216.239.34.10<br />
ns3.google.com. 172742 IN A 216.239.36.10<br />
ns4.google.com. 172742 IN A 216.239.38.10<br />
<br />
;; Query time: 59 msec<br />
;; SERVER: 192.168.1.1#53(192.168.1.1)<br />
;; WHEN: Thu Feb 06 13:34:11 COT 2014<br />
;; MSG SIZE rcvd: 431<br />
<br />
---------------------------------------------------------------------------------------------------------<br />
Para un bind (slave) que funcione como respaldo del primer bind (master)...<br />
<br />
Todo se hace de forma muy similar, pero hay algunos cambios<br />
<br />
En named.conf (slave), las zonas al final del archivo quedan asi (vea que en lugar de la carpeta master, quedan en slave) y con la linea masters se especifica la IP del primer bind (master)<br />
<br />
...<br />
zone "example.com" {<br />
type slave;<br />
file "/usr/local/etc/namedb/slave/example.com";<br />
masters { 192.168.1.1; };<br />
};<br />
<br />
zone "1.168.192.in-addr.arpa" {<br />
type slave;<br />
file "/usr/local/etc/namedb/slave/1.168.192.in-addr.arpa";<br />
masters { 192.168.1.1; };<br />
};<br />
<br />
Los archivos "zona" y "zona inversa" no hay que crearlos ya que se importan automaticamente del primer bind (master).<br />
<br />
Luego de iniciar bind (slave), los archivos seran transferidos desde el primer bind (master) como por arte de magia<br />
<br />
# ls /usr/local/etc/namedb/slave<br />
1.168.192.in-addr.arpa <br />
example.com<br />
---------------------------------------------------------------------------------------------------------AngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com0tag:blogger.com,1999:blog-6410840638905218654.post-38127519220969360432014-02-06T09:12:00.002-05:002015-05-21T07:53:10.435-05:00KDEIntroduccion:<br />
<br />
Instalar el escritorio KDE4.<br />
<br />
Requerimientos:<br />
<br />
* <a href="http://angelcontents.blogspot.com/2014/01/freebsd-100.html" target="_blank">FreeBSD instalado</a><br />
* <a href="http://angelcontents.blogspot.com/2014/02/the-x-window-system.html" target="_blank">The X Window System instalado</a><br />
* Conexion a Internet<br />
* Leer este tutorial<br />
<br />
El proceso:<br />
<br />
Actualizar el arbol de ports<br />
<br />
# portsnap update<br />
<br />
Agregar los parametros recomendados en /etc/make.conf<br />
<br />
# edit /etc/make.conf<br />
<br />
Agregamos las siguientes lineas<br />
<br />
# FreeBSD versions earlier than 10.X require this line<br />
# http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/pkgng-intro.html<br />
#<br />
WITH_PKGNG=yes<br />
<br />
Instalar el meta-port kde4<br />
<br />
# cd /usr/ports/x11/kde4<br />
# make config-recursive<br />
<br />
kde 4.10.5_1<br />
<br />
[ ] KDEACCESSIBILITY Accessibility applications<br />
[ ] KDEADMIN Administration utilities<br />
[ ] KDEARTWORK Additional screensavers and wallpapers <br />
[ ] KDEBINDINGS Bindings for programming languages<br />
[ ] KDEEDU Entertaining, educational programs<br />
[ ] KDEGAMES Collection of games<br />
[ ] KDEGRAPHICS Graphics utilities<br />
[ ] KDEMULTIMEDIA Multimedia applications<br />
[ ] KDENETWORK Network-related programs<br />
[ ] KDEPLASMA Extra plasmoids and plugins for Plasma<br />
[ ] KDESDK Software development kit<br />
[ ] KDETOYS Miscellaneous small applications<br />
[ ] KDEUTILS Set of generic utilities<br />
[ ] KDEWEBDEV Web development environment<br />
───────────────── PIM ─────────────────<br />
( ) KDEPIM Personal information management<br />
( ) KDEPIM44 KDE-Pim 4.4 (legacy version)<br />
<br />
Yo desactivo todo ya que solo quiero KDE4 sin adicionales (EDU, GAMES, etc.), pero se pueden instalar si los desea dejando todo por defecto.<br />
<br />
Los ports "KDEACCESSIBILITY", "KDEADMIN", etc., los puedo dejar por defecto ya que en el meta-port kde4 los desactive y no se instalaran (si se desea instalar EDU, GAMES, etc., tambien se dejan por defecto).<br />
<br />
Los demas ports necesarios para kde4 tambien se dejan las opciones por defecto.<br />
<br />
Nota:<br />
Si tengo problemas con los cambios al meta-port kde4, puedo borrar los ajustes que hice para dejarlo como estaba por defecto e iniciar los ajustes nuevamente con el comando # rm -rf /var/db/ports/*<br />
<br />
# make install clean<br />
<br />
KDE requiere montar /proc para hacerlo editamos /etc/fstab<br />
<br />
# edit /etc/fstab<br />
<br />
Agregamos las siguientes lineas<br />
<br />
# KDE requires the /proc mounted<br />
proc /proc procfs rw 0 0<br />
<br />
Montamos manualmente para no tener que reiniciar<br />
<br />
# mount -a<br />
<br />
Crear el archivo que iniciara kde4 en el home del usuario, que en nuestro ejemplo se llama John Doe y su home es john <br />
<br />
# echo '# KDE' > /home/john/.xinitrc <br />
# echo 'exec /usr/local/bin/startkde' >> /home/john/.xinitrc<br />
# echo 'setxkbmap -option "terminate:ctrl_alt_bksp"' >> /home/john/.xinitrc <br />
# echo '# UTF-8' >> /home/john/.xinitrc<br />
# echo 'export LC_ALL=en_US.UTF-8' >> /home/john/.xinitrc <br />
# echo 'export LANGUAGE=en_US.UTF-8' >> /home/john/.xinitrc <br />
# echo 'export LANG=en_US.UTF-8' >> /home/john/.xinitrc <br />
<br />
Para iniciar kde4 desde el usuario John Doe, usamos<br />
<br />
$ startxAngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com0tag:blogger.com,1999:blog-6410840638905218654.post-44282983485840153532014-02-06T08:06:00.000-05:002015-09-25T14:22:52.620-05:00The X Window SystemIntroduccion:<br />
<br />
Instalar The X Window System en FreeBSD.<br />
<br />
Requerimientos:<br />
<br />
* FreeBSD instalado<br />
* Conexion a Internet<br />
<br />
* Leer este tutorial<br />
<br />
El proceso:<br />
<br />
Actualizar el arbol de ports<br />
<br />
# portsnap update<br />
<br />
Agregar los parametros recomendados en /etc/make.conf<br />
<br />
# edit /etc/make.conf<br />
<br />
Agregamos las siguientes lineas<br />
<br />
# Installing KMS Ports<br />
# https://wiki.freebsd.org/Graphics#Ports<br />
#<br />
WITH_NEW_XORG=yes<br />
WITH_GALLIUM=yes # Needed for Radeon cards, but doesn't harm with Intel devices.<br />
#<br />
# FreeBSD versions earlier than 10.X require this line<br />
# http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/pkgng-intro.html<br />
#<br />
WITH_PKGNG=yes<br />
<br />
Instalar el port xorg<br />
<br />
# cd /usr/ports/x11/xorg<br />
# make config-recursive<br />
<br />
xorg-apps 7.7<br />
<br />
(dejo todo como esta por defecto)<br />
<br />
xorg-drivers 7.7<br />
<br />
[X] MOUSE Install mouse input driver<br />
[X] KEYBOARD Install keyboard input driver<br />
<br />
desactivo todo y solo dejo estos tres activados<br />
<br />
python27-2.7.6_1 (todo por defecto)<br />
libdrm-2.4.17_1 (todo por defecto)<br />
xterm-300 (todo por defecto)<br />
pixman-0.30.2 (tod por defecto)<br />
xf86-video-radeonhd-1.3.0_5 (tod por defecto)<br />
libxml2-2.8.0_3 (todo por defecto)<br />
m4-1.4.17,1 (todo por defecto)<br />
perl5-5.16.3_4 (todo por defecto)<br />
png-1.5.17 (todo por defecto)<br />
freetype2-2.5.0.1 (todo por defecto)<br />
dejavu-2.34 (todo por defecto)<br />
xorg-server-1.7.7_11,1 (todo por defecto)<br />
libcheck-0.9.11 (todo por defecto)<br />
libxslt-1.1.28_1 (todo por defecto)<br />
hal-0.5.14_22 (todo por defecto)<br />
xkeyboard-config-2.9_1 (todo por defecto)<br />
policykit-0.9_6 (todo por defecto)<br />
docbook-xsl-1.76.1_1 (todo por defecto)<br />
glib-2.36.3_1 (todo por defecto)<br />
pcre-8.33 (todo por defecto)<br />
polkit-0.105_1 (todo por defecto)<br />
unzip-6.0_1 (todo por defecto)<br />
xmlcatmgr-2.2 (todo por defecto)<br />
docbook-1.4_1 (todo por defecto)<br />
dbus-1.6.12 (todo por defecto)<br />
libffi-3.0.13 (todo por defecto)<br />
docbook-5.0_1 (todo por defecto)<br />
cairo-1.10.2_6,2 (todo por defecto)<br />
<br />
# make install clean<br />
<br />
Agregar estas lineas para cargar al inicio<br />
<br />
# echo '# X11 Configuration' >> /etc/rc.conf<br />
# echo 'hald_enable="YES"' >> /etc/rc.conf<br />
# echo 'dbus_enable="YES"' >> /etc/rc.conf<br />
<br />
Iniciarlo complementos (start|stop|restart)<br />
# /usr/local/etc/rc.d/dbus start<br />
# /usr/local/etc/rc.d/hald start<br />
<br />
Crear el archivo xorg.conf.new basico<br />
# rehash<br />
# Xorg -configure<br />
<br />
Editar el archivo con los parametros para el monitor<br />
<br />
# edit /root/xorg.conf.new<br />
<br />
En mi caso tengo este monitor<br />
http://support.dell.com/support/edocs/systems/1907FP/en/about.htm#Specifications<br />
<br />
En la seccion "Monitor" le agregamos HorizSync, VertRefresh y Option "DPMS"<br />
<br />
Section "Monitor"<br />
Identifier "Monitor0"<br />
VendorName "Monitor Vendor"<br />
ModelName "Monitor Model"<br />
HorizSync 30-81<br />
VertRefresh 56-76<br />
Option "DPMS"<br />
EndSection<br />
<br />
En la seccion "Screen" solo dejamos Depth 24 y Modes "1280x1024"<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Card0"<br />
Monitor "Monitor0"<br />
SubSection "Display"<br />
Viewport 0 0<br />
Depth 24<br />
Modes "1280x1024"<br />
EndSubSection<br />
EndSection<br />
<br />
Probamos nuestro archivo para ver si funciona bien<br />
<br />
# Xorg -config /root/xorg.conf.new -retro<br />
<br />
Esto inicia las X, para pararlo<br />
<br />
Ctrl+Alt+F1 y usamos Ctrl+C<br />
<br />
Nota:<br />
En mi caso con una tarjeta Nvidia, no carga las X, pero luego con el driver de nvidia todo funciona bien.<br />
<br />
Copiar el archivo al lugar correcto con el nombre final<br />
<br />
# cp /root/xorg.conf.new /etc/X11/xorg.conf<br />
<br />
Instalar el driver de Nvidia<br />
<br />
# cd /usr/ports/x11/nvidia-driver<br />
# make config-recursive<br />
<br />
nvidia-driver-319.32<br />
<br />
[ ] ACPI_PM ACPI_PM Power Management support<br />
[X] DOCS Build and/or install documentation<br />
[ ] LINUX Linux compatibility support<br />
[ ] WBINVD Flush CPU caches directly with WBINVD<br />
<br />
<OK><br />
<br />
# make install clean<br />
<br />
Cargar manualmente el modulo<br />
<br />
# kldload nvidia<br />
<br />
Agregar estas lineas para cargar al inicio<br />
<br />
# echo '# NVIDIA Driver' >> /boot/loader.conf<br />
# echo 'nvidia_load="YES"' >> /boot/loader.conf<br />
<br />
Editar el archivo para usar el driver nvidia en lugar de nv<br />
<br />
# edit /etc/X11/xorg.conf<br />
<br />
cambiar la linea original<br />
<br />
Driver "nv"<br />
<br />
por<br />
<br />
Driver "nvidia"<br />
<br />
Instalar el port mesa-demos para poder usar glxgears y glxinfo<br />
<br />
# cd /usr/ports/graphics/mesa-demos<br />
# make install clean<br />
<br />
Otros ports relacionados con NVIDIA<br />
x11/nvidia-settings<br />
x11/nvidia-xconfig AngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com0tag:blogger.com,1999:blog-6410840638905218654.post-83213848859953773842014-01-23T07:26:00.000-05:002018-08-02T10:02:15.428-05:00FreeBSD 10.0Introduccion:<br />
<br />
Instalar FreeBSD 10.0-RELEASE AMD64<br />
<br />
Requerimientos:<br />
<br />
* Conexion a Internet<br />
* Disco de instalacion de FreeBSD <br />
* Leer este tutorial<br />
<br />
Tutoriales:<br />
<div>
<br /></div>
<div>
<div>
http://docs.freebsd.org/doc/6.3-RELEASE/usr/share/doc/handbook/portsnap.html</div>
<div>
<br /></div>
<div>
El proceso:<br />
<br />
Iniciar el equipo con el disco de FreeBSD<br />
<br />
FreeBSD Installer<br />
<br />
Welcome<br />
Welcome to FreeBSD! Would you<br />
like to begin an installation<br />
or use the live CD?<br />
<br />
<b><Install></b><br />
<br />
FreeBSD Installer<br />
-------------------------------------------------------------------------------------------------------------------- <br />
Keymap Selection<br />
The system console driver for FreeBSD defaults to standard "US"<br />
keyboard map. Other keymaps can be chosen below.<br />
<br />
>>> Continue wiht default keymap <- Cuando mi teclado es en English<br />
<br />
O me desplazo para abajo hasta el idioma correcto<br />
<br />
( ) Latin American<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-Vx8A2nObNW8/UuEZnjd6waI/AAAAAAAAGSY/sSqKwutzFyk/s1600/LATINOAMERICANO.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="106" src="https://2.bp.blogspot.com/-Vx8A2nObNW8/UuEZnjd6waI/AAAAAAAAGSY/sSqKwutzFyk/s1600/LATINOAMERICANO.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
( ) Spanish ISO-8859-1<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-xiZJA2jxyTY/UuEZryqWz-I/AAAAAAAAGSg/ZUEDh3XAszg/s1600/ESPANOL.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="106" src="https://4.bp.blogspot.com/-xiZJA2jxyTY/UuEZryqWz-I/AAAAAAAAGSg/ZUEDh3XAszg/s1600/ESPANOL.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
Luego de estar en el idioma correcto (Latin American o Spanish ISO-8859-1)<br />
<br />
<b><Select></b><br />
<br />
>>> Continue wiht spanish.kbd/latinamerican.kbd keymap<br />
<br />
<b><Select></b><br />
<br />
Set Hostname<br />
Please choose a hostname for this machine.<br />
<br />
If you are running on managed network, please<br />
ask your network administrator for an appropriate<br />
name.<br />
<br />
freebsd.example.com<br />
<br />
<b><OK></b><br />
<br />
Distribution Select<br />
Choose optional system components to<br />
install:<br />
<br />
[ * ] doc Additional documentation<br />
[ ] games Games (fortune, etc.)<br />
[ ] lib32 32-bit compatibility libraries<br />
[ * ] ports Ports tree<br />
[ * ] src System source code<br />
<br />
<b><OK></b><br />
<br />
Partitioning<br />
How would you like topartition your disk?<br />
<br />
<b><Manuall></b><br />
<br />
<b><OK> </b><br />
<br />
Partition Editor<br />
Create partitions for FreeBSD. No changes will be<br />
made until you select Finish.<br />
<br />
ada0 298 GB (none)<br />
<br />
GPT GUID Partition Table<br />
<br />
<b><OK></b><br />
<br />
<b><OK></b><br />
<br />
<b><Create></b><br />
<br />
Type: freebsd-boot<br />
Size: 512K<br />
Mountpoint:<br />
Label:<br />
<br />
<b><OK></b><br />
<br />
<b><Create></b><br />
<br />
Type: freebsd-ufs<br />
Size: 16GB<br />
Mountpoint: /<br />
Label: exrootfs<br />
<br />
<b><OK></b><br />
<br />
<b><Create></b><br />
<br />
Type: freebsd-swap<br />
Size: 32GB<br />
Mountpoint: <br />
Label: exswap<br />
<br />
<b><OK></b><br />
<br />
<b><Create></b><br />
<br />
Type: freebsd-ufs<br />
Size: 64GB<br />
Mountpoint: /var <br />
Label: exvarfs<br />
<br />
<b><OK></b><br />
<br />
<b><Create></b><br />
<br />
Type: freebsd-ufs<br />
Size: 16GB<br />
Mountpoint: /tmp <br />
Label: extmpfs<br />
<br />
<b><OK></b><br />
<br />
<b><Create></b><br />
<br />
Type: freebsd-ufs<br />
Size: XXGB <- lo que quede disponible<br />
Mountpoint: /usr <br />
Label: exusrfs<br />
<br />
<b><OK></b><br />
<br />
ada0 298 GB GPT<br />
ada0p1 512 kb freebsd-boot<br />
ada0p2 16.0 GB freebsd-ufs /<br />
ada0p3 32.0 GB freebsd-swap none<br />
ada0p4 64.0 GB freebsd-ufs /var<br />
ada0p5 16.0 GB freebsd-ufs /tmp<br />
ada0p6 XX.0 GB freebsd-ufs /usr<br />
<br />
<b><Finish></b><br />
<br />
Confirmation<br />
Your changes will now written to disk. If you<br />
have chosen to overwrite existing data, it will<br />
be PERMANENTLY ERASED. Are you sure you want to<br />
commit your changes?<br />
<br />
<b><Commit></b><br />
<br />
(inicia particionado e instalacion)<br />
<br />
FreeBSD Installer<br />
-------------------------------------------------------------------------------------------------------------------- <br />
<br />
Please select a password for the system management account (root):<br />
Changing local password for root<br />
New Password: ********<br />
Retype New Password: ********<br />
<br />
Network Configuration<br />
Please select a network interface to configure:<br />
<br />
em0 Intel(R) PRO/1000 Legacy Network Connection 1.0.3<br />
em1 Intel(R) PRO/1000 Legacy Network Connection 1.0.3<br />
em2 Intel(R) PRO/1000 Legacy Network Connection 1.0.3<br />
em3 Intel(R) PRO/1000 Legacy Network Connection 1.0.3<br />
<br />
<b><OK></b><br />
<br />
Network Configuration<br />
Would you like to<br />
configure IPv4 for this<br />
interface?<br />
<br />
<b><Yes></b><br />
<br />
Network Configuration<br />
Would you like to use<br />
DHCP to configure this<br />
interface?<br />
<br />
<b><No></b><br />
<br />
Network Configuration<br />
Static Network Interface Configuration<br />
<br />
IP Address 192.168.0.2<br />
Subnet Mask 255.255.255.0<br />
Default Router 192.168.0.1<br />
<br />
<b><OK></b> <br />
<br />
Network Configuration<br />
Would you like to<br />
configure IPv6 for this<br />
interface?<br />
<br />
<b><Yes></b><br />
<br />
Network Configuration<br />
Would you like to try<br />
stateless address<br />
autoconfiguration<br />
(SLAAC)?<br />
<br />
<b><Yes></b><br />
<br />
Network Configuration<br />
Resolver Configuration<br />
Search example.com<br />
IPv6 DNS #1 2001:4860:4860::8888<br />
IPv6 DNS #2 2001:4860:4860::8844<br />
IPv4 DNS #1 8.8.8.8<br />
IPv4 DNS #2 8.8.4.4<br />
<br />
<b><OK></b><br />
<br />
Nota:<br />
En
nuestro caso estamos usando los DNS publicos de Google (IPv4 8.8.8.8
8.8.4.4 IPv6 2001:4860:4860::8888 2001:4860:4860::8844), mas informacion
aqui https://developers.google.com/speed/public-dns/<br />
<br />
Select local or UTC (Greenwich Mean Time) clock<br />
Is this machine´s CMOS clock set to UTC? If it is set to local time,<br />
or you don´t know, please choose NO here!<br />
<br />
<b><No></b><br />
<br />
Time Zone Selector<br />
Select a region<br />
<br />
2 America -- North and South<br />
<br />
Countries in America -- North and South<br />
<br />
14 Colombia <br />
<br />
<b><OK></b><br />
<br />
Does the abbreviation `COT´ look reasonable?<br />
<br />
<b><Yes></b><br />
<br />
System Configuration<br />
Choose the services you would like to be started at boot:<br />
<br />
[*] sshd Secure shell daemon<br />
[ ] moused PS/2 mouse pointer on console<br />
[ ] ntpd Synchronize system and network time<br />
[ ] powerd Adjust CPU frequency dynamically<br />
[*] dumpdev Enable kernel crash dumps to /var/crash<br />
<br />
<b><OK></b><br />
<br />
Add User Accounts<br />
Would you like to add<br />
users to the installed<br />
system now?<br />
<br />
<b><Yes></b><br />
<br />
FreeBSD Installer<br />
==================<br />
Add Users<br />
<br />
Username: john<br />
Full name: John Doe<br />
Uid (Leave empty for default):<br />
Login group [john]:<br />
Login group is john. Invite john into other groups? []:<br />
Shell (sh csh tcsh nologin) [sh]:<br />
Home directory [/home/john]:<br />
Home directory permissions (Leave empty for default):<br />
Use password-based authentication? [yes]:<br />
Use an empty password? (yes/no) [no]: <br />
Use a randon password? (yes/no) [no]:<br />
Enter password: ********<br />
Enter password again: ********<br />
Lock out the account after creation? [no]:<br />
Username : john <br />
Password : ********<br />
Full Name : John Doe <br />
Uid : 1001<br />
Class :<br />
Groups : john<br />
Home : /home/john<br />
Home Mode :<br />
Shell : /bin/sh<br />
Locked : no<br />
OK? (yes/no) : <b>yes</b><br />
adduser: INFO : Successfully added (john) to the user database.<br />
Add another user? (yes/no): <b>no</b><br />
Goodbye!<br />
<br />
Final Configuration<br />
Setup of your FreeBSD system is nearly complete. You can now<br />
modify your configuration choices. After this screen, you will<br />
have an opportunity to make more complex changes using a shell<br />
<br />
Exit Apply configuration and exit installer<br />
<br />
<b><OK></b><br />
<br />
Manual Configuration<br />
The installation is now finished.<br />
Before exiting the installer, would<br />
you like to open a shell in the new<br />
system to make any final manual<br />
modification?<br />
<br />
<b><No></b><br />
<br />
Complete<br />
Installation of FreeBSD<br />
complete! Would you like<br />
to reboot into the<br />
installed system now?<br />
<br />
<b><Reboot></b><br />
<br />
(retirar el CD/DVD/USB en el reinicio para iniciar desde el disco duro)<br />
<br />
Aplicar los ultimos parches<br />
<br />
# freebsd-update fetch<br />
# freebsd-update install<br />
<br />
Actualizar el arbol de ports<br />
<br />
# portsnap fetch extract<br />
# portsnap fetch update<br />
<br />
Finalmente reiniciamos<br />
<br />
# reboot<br />
<br />
Eso es todo, al iniciar tenemos nuestro FreeBSD funcionando! <br />
<br />
Es buen momento para hacer que FreeBSD este con archivos actualizados, para esto agregamos en /etc/crontab las lineas asi:<br />
<br />
# echo '# Actualizaciones para FreeBSD' >> /etc/crontab <br />
# echo '00 06 * * * root /usr/sbin/freebsd-update cron' >> /etc/crontab<br />
<br />
<span style="font-family: sans-serif;"># echo '# Actualizaciones arbol de ports' >> /etc/crontab </span><br />
<span style="font-family: sans-serif;"># echo '00 06 * * * root /usr/sbin/</span><span style="line-height: 16px;">portsnap -I cron update'</span><span style="font-family: sans-serif;"> >> /etc/crontab</span><br />
<div>
<br />
<div>
Con
esas lineas se ejecutan procesos a las 06:00 horas y la ultima parte "cron" hace un aleatorio entre 1 y 3600 segundos para no saturar el servidor
remoto.<br />
<br />
Para sincronizar manualmente nuestro arbol de ports<br />
<br />
# portsnap update<br />
<br />
Activamos el auto chequeo de los discos en caso que no se apague bien o por algun bloqueo <br />
<br />
# echo '# Verificar con FSCK' >> /etc/rc.conf<br />
# echo 'fsck_y_enable="YES"' >> /etc/rc.conf<br />
# echo 'background_fsck="NO"' >> /etc/rc.conf<br />
# echo '#background_fsck_delay="60"' >> /etc/rc.conf<br />
<br />
Si luego queremos ajustar parametros de la instalacion:<br />
<br />
# edit /etc/rc.conf<br />
<br />
hostname="freebsd.example.com"<br />
ifconfig_em0=" inet 192.168.0.2 netmask 255.255.255.0"<br />
defaultrouter="192.168.0.1"<br />
ifconfig_em0_ipv6="inet6 accept_rtadv"<br />
ssh_ennable="YES"<br />
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable<br />
dumpdev="AUTO" <br />
<br />
# Ajustar el idioma del teclado (solo activar una, si ninguna esta activa queda en English)<br />
#keymap="spanish.iso.kbd"<br />
keymap="latinamerican.kbd"<br />
<br />
# edit /etc/resolv.conf<br />
<br />
search example.com <br />
nameserver 2001:4860:4860::8888<br />
nameserver 2001:4860:4860::8844<br />
nameserver 8.8.8.8<br />
nameserver 8.8.4.4<br />
<br />
# edit /etc/hosts<br />
<br />
::1 localhost localhost.my.domain<br />
127.0.0.1 localhost localhost.my.domain<br />
<br />
Para apagar nuestro FreeBSD instalado, usamos el comando:<br />
<br />
# shutdown -h now<br />
<br />
(con las nuevas boards puede apretar el boton de power e inicia el apagado)<br />
<br />
Para reiniciarlo<br />
<br />
# shutdown -r now<br />
<br />
Parametros recomendados para /etc/make.conf<br />
<br />
# edit /etc/make.conf<br />
<br />
Agregamos las siguientes lineas<br />
<br />
# CUPS-Related Ports<br />
# https://wiki.freebsd.org/Ports/Options/OptionsNG#What_users_need_to_know<br />
# http://lists.freebsd.org/pipermail/freebsd-ports/2013-June/084148.html<br />
# <br />
OPTIONS_SET=CUPS<br />
#<br />
# Qt 4 can be built with optional supporin for:<br />
# - Common UNIX Printing System (CUPS)<br />
# - Network Audio System (NAS)<br />
# - Qt style that renders using GTK (QGTKSTYLE)<br />
#<br />
QT4_OPTIONS= CUPS NAS QGTKSTYLE<br />
#<br />
# Installing KMS Ports<br />
# https://wiki.freebsd.org/Graphics#Ports<br />
#<br />
WITH_NEW_XORG=yes<br />
#<br />
# FreeBSD versions earlier than 10.X require this line<br />
# http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/pkgng-intro.html <br />
#<br />
WITH_PKGNG=yes<br />
#<br />
# Depurar errores en los ports<br />
#<br />
#CMAKE_VERBOSE=yes<br />
#MAKE_JOBS_UNSAFE=yes<br />
<br />
Instalar nuestro primer port llamado portmaster (en FreeBSD 10.0 ya viene instalado, pero lo dejare de ejemplo)<br />
<br />
# cd /usr/ports/ports-mgmt/portmaster<br />
# make install clean<br />
<br />
Limpiar los fuentes descargados en /usr/ports/distfiles de ports que ya no tenemos instalados<br />
<br />
# portmaster -y --clean-distfiles<br />
<br />
Otros comandos utiles<br />
<br />
# make -C /usr/ports/ports-mgmt/portmaster config<br />
# cd /usr/ports/ports-mgmt/portmaster && make showconfig<br />
<br />
Si queremos eliminar todos los ports instalados<br />
<br />
# rm -rf /usr/local/* /var/db/pkg /compat/linux<br />
<br />
Si queremos eliminar todos los cambios que hicimos en un port<br />
<br />
# rm /var/db/ports/nombreport/options<br />
<br />
Si queremos eliminar todos los cambios que hicimos en todos los ports<br />
<br />
# rm -rf /var/db/ports/*<br />
<br />
Quien es John Doe? <a href="http://en.wikipedia.org/wiki/John_Doe">http://en.wikipedia.org/wiki/John_Doe</a><br />
<br />
Para hacer la instalacion en un RAID1 <a href="http://www.unix.ck.ua/content/sozdaem-programmnyi-raid1-freebsd-90" target="_blank">http://www.unix.ck.ua/content/sozdaem-programmnyi-raid1-freebsd-90 </a><br />
<br />
Nota:<br />
FreeBSD
envia automaticamente reportes de estado al usuario root y solo los
vemos si iniciamos localmente con este usuario, pero podemos hacer que
estos reportes sean enviados a una cuenta en otro lugar, por ejemplo a
nuestra cuenta en Gmail, para hacer esto debemos:<br />
<br />
# edit /etc/mail/aliases<br />
<br />
Buscamos una linea que dice<br />
<br />
# root: me@my.domain<br />
<br />
Y luego de esa creamos una nueva con nuestro mail <br />
root: micorreo@gmail.com<br />
<br />
Guardamos los cambios en el editor y ejecutamos el comando<br />
<br />
# cd /etc/mail && make<br />
<br />
Si root tiene un monton de correos, los podemos eliminar con<br />
<br />
# cat /dev/null > /var/mail/root <br />
<br />
FreeBSD
nos permite conectar por SSH a nuestro servidor, pero por seguridad no
se puede hacer con el usuario root, entonces primero nos conectamos con
el usuario john y luego podemos usar el comando su para subir a root,
pero para que john pueda subir, hay que darle permisos a este usuario,
para esto<br />
<br />
# edit /etc/group<br />
<br />
y la linea original<br />
<br />
wheel:*:0:root<br />
<br />
la dejamos asi<br />
<br />
wheel:*:0:root, john<br />
<br />
Guardamos cambios y ya podemos conectarnos, ejemplo desde otro equipo con FreeBSD desde el terminal<br />
<br />
$ ssh john@IPMISERVIDOR<br />
Password: ******** <- la clave del usuario john<br />
$<br />
Para subir a root escribimos su<br />
$ su<br />
Password: ******** <- la clave del usuario root<br />
freebsd #<br />
<br />
En caso de tener un bloqueo en el equipo, podemos usar el siguiente comando:<br />
<br />
# kgdb /boot/kernel/kernel.symbols /var/crash/vmcore.0<br />
(kgdb) backtrace <- luego escribimos esto y damos enter <br />
<br />
Activar UTF-8 "Alternately, the superuser" (si tenemos acceso a root)<br />
<br />
Ver las localizaciones disponibles<br />
<br />
$ locale -a | grep '\.UTF-8$'<br />
<br />
# edit /etc/login.conf<br />
<br />
Modificar esta seccion de modo que quede asi:<br />
<br />
default:\<br />
:passwd_format=sha512:\<br />
:copyright=/etc/COPYRIGHT:\<br />
:welcome=/etc/motd:\<br />
:setenv=MAIL=/var/mail/$,BLOCKSIZE=K<span style="color: red;">,LC_COLLATE=C</span>:\<br />
:path=/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin ~/bin:\<br />
:nologin=/var/run/nologin:\<br />
:cputime=unlimited:\<br />
:datasize=unlimited:\<br />
:stacksize=unlimited:\<br />
:memorylocked=64K:\<br />
:memoryuse=unlimited:\<br />
:filesize=unlimited:\<br />
:coredumpsize=unlimited:\<br />
:openfiles=unlimited:\<br />
:maxproc=unlimited:\<br />
:sbsize=unlimited:\<br />
:vmemoryuse=unlimited:\<br />
:swapuse=unlimited:\<br />
:pseudoterminals=unlimited:\<br />
:priority=0:\<br />
:ignoretime@:\<br />
:umask=022:<span style="color: red;">\</span><br />
<span style="color: red;">:charset=UTF-8:\</span><br />
<span style="color: red;">:lang=en_US.UTF-8:</span><br />
<br />
Mire con atencion, las partes en <span style="color: red;">rojo</span> es lo que debemos agregar (<span style="color: red;">,</span><span style="color: red;">LC_COLLATE=C</span>, <span style="color: red;">\</span>, <span style="color: red;">:charset=UTF-8:\</span> y <span style="color: red;">:lang=en_US.UTF-8:</span>)<br />
<br />
Aplicar los cambios <br />
<br />
# cap_mkdb /etc/login.conf<br />
<br />
Verificar, cerrar la sesion del usuario, entrar de nuevo y verificar con este comando<br />
<br />
$ locale<br />
LANG=en_US.UTF-8<br />
LC_CTYPE="en_US.UTF-8"<br />
LC_COLLATE="en_US.UTF-8"<br />
LC_TIME="en_US.UTF-8"<br />
LC_NUMERIC="en_US.UTF-8"<br />
LC_MONETARY="en_US.UTF-8"<br />
LC_MESSAGES="en_US.UTF-8"<br />
LC_ALL=<br />
<br />
Ajustar el volumen de salida de FreeBSD<br />
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/sound-setup.html <br />
<br />
$ mixer -s vol 100 <br />
<br />
Para dejarlo permanentemente al 100 a nivel de driver<br />
<br />
# echo '# Setting Default Values for Mixer Channels' >> /boot/device.hints<br />
# echo 'hint.pcm.0.vol="100"' >> /boot/device.hints</div>
</div>
</div>
</div>
<div>
<br /></div>
<div>
Poner a Beastie, la mascota de FreeBSD</div>
<div>
<br /></div>
<div>
# edit /boot/loader.conf</div>
<div>
<br /></div>
<div>
# Devil worship in loader logo<br />
loader_logo="beastie"</div>
<div>
<br />
En recientes versiones de FreeBSD, luego de la instalacion, podemos configurar parametros mediante el comando<br />
<br />
# bsdconfig</div>
AngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com0tag:blogger.com,1999:blog-6410840638905218654.post-4849200852561310402013-12-13T09:42:00.000-05:002014-10-22T12:46:03.442-05:00OpenVPNIntroducion:<br />
<br />
Configurar el servicio de OpenVPN en nuestro equipo, para saltar los bloqueos geograficos de algunos servicios en Interntet (Netflix, Google Play Store), seguridad o por simple curiosidad de ver como funciona una VPN.<br />
<br />
Existen varias opciones para VPN, puede ver una comparacion muy buena donde se ve claramente que OpenVPN es la mejor <a href="https://www.ivpn.net/knowledgebase/62/PPTP-vs-L2TP-vs-OpenVPN.html" target="_blank">PPTP vs L2TP vs OpenVPN</a>.<br />
<br />
24/04/2014: Se actualizan los archivos de configuracion debido a un comunicado oficial de OpenVPN referente al "Heartbleed bug" <a href="https://medium.com/p/686bb0851387">https://medium.com/p/686bb0851387</a>, tambien ya hay dos archivos para usar indistintamente.<br />
<br />
Requerimientos:<br />
<br />
* Comprar el servicio de VPN en blackVPN (que funciona con tun)<br />
* Un equipo con algun Sistema Operativo compatible (Android, FreeBSD, GNU/Linux, OS X y Windows)<br />
* Leer este manual<br />
<br />
Manuales consultados:<br />
<br />
http://openvpn.net/index.php/open-source/documentation/manuals.html<br />
https://www.blackvpn.com/howto/save-username-and-password-in-openvpn<br />
http://code.google.com/p/tunnelblick/wiki/UsingTunnelblick<br />
<br />
El proceso:<br />
<br />
Comprar el servicio de VPN de blackVPN, un magnifico proveedor que encontre, con un muy buen precio, sin limites en el trafico (muy importante si queremos ver contenidos multimedia de por ejemplo Netflix) y que funciona sin tener que hacer ajustes complicados (por que en Android usar tap es un problema y la mayoria de servicios de VPN requieren tab).<br />
<br />
Entrar a <a href="http://www.blackvpn.com/" target="_blank">blackVPN</a> y comprar el servicio llamado 'SINGLE SERVER', que consiste en poder conectar solo a uno de los servidores y que es suficiente, en nuestro ejemplo usare el de USA (US), yo compre '1 Mont 5 <a href="https://www.blackvpn.com/checkout/us" target="_blank">USA USA TV/audio'</a>.<br />
<br />
Al terminar de hacer la compra, recibiremos los datos de usuario y clave, guardarlos bien ya que son los datos que pondremos en auth.txt.<br />
<br />
Descargar los archivos de configuracion de VPN de blackVPN<br />
Entramos a <a href="https://www.blackvpn.com/support" target="_blank">*SUPPORT/HELP</a> y Downloads.<br />
<br />
En este lugar buscamos el archivo en la seccion 'Separate country files for OpenVPN by ARNE SCHWABE on Android 4.x' llamado <a href="https://www.blackvpn.com/?wpdmact=process&did=ODEuaG90bGluaw==" target="_blank">US – USA: blackvpn_usa.ovpn</a>, lo descargamos en nuestro equipo. <br />
<br />
En mi caso le hice algunos ajustes, basicamente actualizacion de algunas lineas que daban 'Warning' o que estaban 'Deprecated' y le agregue la linea a un archivo llamado 'auth.txt' donde meto el login y password.<br />
<br />
Ejemplo archivo .ovpn para Android con la autenticacion mediante el archivo 'auth.txt':<br />
<br />
#------------------------------contenido archivo .ovpn inicio------------------------------<br />
<br />
# Activar solo una de las siguientes lineas! <br />
#auth-user-pass<br />
#auth-user-pass auth.txt<br />
auth-user-pass /sdcard/BlackVPN/auth.txt<br />
#auth-user-pass "C:\\Archivos de programa\\OpenVPN\\config\\auth.txt"<br />
#auth-user-pass "C:\\Program Files\\OpenVPN\\config\\auth.txt"<br />
#auth-user-pass "C:\\Archivos de programa (x86)\\OpenVPN\\config\\auth.txt"<br />
#auth-user-pass "C:\\Program Files (x86)\\OpenVPN\\config\\auth.txt"<br />
remote westcoast.vpn.blackvpn.com 443 udp<br />
client<br />
dev tun<br />
fast-io<br />
persist-key<br />
persist-tun<br />
nobind<br />
pull<br />
comp-lzo<br />
tls-client<br />
key-method 2<br />
#tls-remote usa<br />
ns-cert-type server<br />
<ca><br />
-----BEGIN CERTIFICATE-----<br />
<- Aqui falta el contenido CERTIFICATE<br />
-----END CERTIFICATE-----<br />
</ca><br />
key-direction 1 <br />
<tls-auth><br />
-----BEGIN OpenVPN Static key V1-----<br />
<- Aqui falta el contenido KEY<br />
-----END OpenVPN Static key V1-----<br />
</tls-auth><br />
cipher AES-256-CBC<br />
#txqueuelen 486<br />
sndbuf size 1655368<br />
rcvbuf size 1655368<br />
auth SHA512<br />
hand-window 37<br />
mssfix 1400<br />
verb 3<br />
mute 10<br />
<br />
# Nota:<br />
# Si usa Windows para crear el archivo auth.txt, use el WORDPAD en lugar del NOTEPAD!<br />
<br />
#------------------------------contenido archivo .ovpn fin------------------------------<br />
<br />
Descargue el archivo completo (que incluye el contenido CERTIFICATE y KEY, que no puse en el .ovpn de ejemplo) de <a href="https://drive.google.com/folderview?id=0B-ODrM4HjfLrN1lscVE4QVJvaTQ&usp=sharing" target="_blank">Google Drive</a><br />
<br />
Archivo 'auth.txt':<br />
Este archivo contiene en la primera linea el usuario y en la segunda la clave (he notado que si se crea en Windows usando el NOTEPAD queda malo, si usa Windows use el WORDPAD), ejemplo<br />
<br />
b1234567 <- primera linea el usuario<br />
xYz1234 <- segunda linea la clave<br />
<br />
Equipos con Android, usando un explorador de archivos como <a href="https://play.google.com/store/apps/details?id=com.estrongs.android.pop&hl=en" target="_blank">'ES File Explorer File Manager'</a> de ESS APP Group, creamos la carpeta BlackVPN en /sdcard y metemos el archivo blackvpn_usa.ovpn y auth.txt en ese lugar, la ruta al archivo auth.txt se especifica asi:<br />
<br />
#auth-user-pass<br />
auth-user-pass /sdcard/BlackVPN/auth.txt<br />
<br />
Equipos con sistemas tipo Unix, como FreeBSD o GNU/Linux, la ruta al archivo auth.txt se especifica asi:<br />
<br />
#auth-user-pass<br />
auth-user-pass auth.txt<br />
<br />
Meta ambos archivos blackvpn_usa.ovpn y auth.txt en la carpeta del programa openvpn, por ejemplo en el caso de FreeBSD la ruta es /usr/local/etc/openvpn/<br />
<br />
<a href="http://code.google.com/p/tunnelblick/issues/detail?id=219" target="_blank">En OS X actualmente el cliente Tunnelblick 3.3 (build 3518) no puede leer usuario y clave desde un archivo auth.txt</a><br />
<br />
Equipos con Windows (ajuste la ruta segun el idioma y si es a 64-bit o 32-bit), la ruta al archivo auth.txt se especifica asi:<br />
<br />
#auth-user-pass<br />
auth-user-pass "C:\\Program Files (x86)\\OpenVPN\\config\\auth.txt"<br />
<br />
Por favor mire que tenemos que usar " " y \\ para la ruta en Windows!<br />
Tambien hay que activar la linea<br />
<br />
dev-node openvpn<br />
<br />
Descargar el programa VPN para nuestro equipo segun el Sistema Operativo que tenga<br />
<br />
- Android (ver instruccion)<br />
Use <a href="https://play.google.com/store/apps/details?id=de.blinkt.openvpn&hl=en" target="_blank">'OpenVPN for Android'</a> de Arne Schwabe mediante la Google Play Store<br />
<br />
- FreeBSD (ver instruccion)<br />
Use 'OpenVPN' mediante el port /usr/ports/security/openvpn<br />
<br />
- GNU/Linux (ver instruccion)<br />
Use 'OpenVPN' mediante el sistema de paquetes que tenga su distribucion (RPM, APT, YasT)<br />
<br />
- Mac OS X (ver instruccion)<br />
Use <a href="https://code.google.com/p/tunnelblick" target="_blank">'Tunnelblick'</a><br />
<br />
- Windows (ver instruccion)<br />
Use <a href="http://openvpn.net/index.php/open-source.html" target="_blank">'OpenVPN'</a> <br />
<br />
<b>Instrucciones:</b><br />
<ul>
<li><i>Instruccion Android</i><b> </b></li>
</ul>
<ul>
</ul>
<b>Para configurar</b><br />
Abrir OpenVPN for Android<br />
Usando el icono de la carpeta, entre a sdcard / BlackVPN<br />
Toque el archivo blackvpn_usa.ovpn<br />
Select<br />
Click en el diskette para guardar<br />
<b>Para conectar </b><br />
Abrir OpenVPN for Android<br />
En la pestaña Profile seleccione blackvpn_USA<br />
* I trust this application.<br />
OK<br />
<ul>
<li><i>Instruccion FreeBSD</i></li>
</ul>
<b>Para configurar</b> <br />
# portsnap update <br />
# make -C /usr/ports/security/openvpn config<br />
[x] PW_SAVE Interactive passwords may be read from a file <br />
# cd /usr/ports/security/openvpn && make install clean<br />
# echo '# OpenVPN' >> /etc/rc.conf<br />
# echo 'openvpn_enable="YES"' >> /etc/rc.conf<br />
# echo 'openvpn_if="tun"' >> /etc/rc.conf<br />
# echo 'openvpn_flags=""' >> /etc/rc.conf<br />
# echo 'openvpn_configfile="/usr/local/etc/openvpn/blackvpn_usa.ovpn"' >> /etc/rc.conf <br />
# echo 'openvpn_dir="/usr/local/etc/openvpn"' >> /etc/rc.conf <br />
# kldload if_tap<br />
# echo '# OpenVPN' >> /boot/loader.conf<br />
# echo 'if_tap_load="YES"' >> /boot/loader.conf<br />
# touch /var/log/openvpn-status.log<br />
# chmod 0777 /var/log/openvpn-status.log <br />
# mkdir /usr/local/etc/openvpn <br />
# edit /usr/local/etc/openvpn/blackvpn_usa.ovpn<br />
pegamos el contenido del archivo .ovpn, salimos del editor y guardamos (Esc a a)<br />
# echo 'status /var/log/openvpn-status.log' >> /usr/local/etc/openvpn/blackvpn_usa.ovpn<br />
# touch /usr/local/etc/openvpn/auth.txt<br />
# echo 'b1234567' >> /usr/local/etc/openvpn/auth.txt<br />
# echo 'xYz1234' >> /usr/local/etc/openvpn/auth.txt<br />
Para depurar errores usar<br />
# tail -f /var/log/messages<b> </b><br />
# tail -f /var/log/openvpn-status.log<br />
<b>Para conectar</b> <br />
# /usr/local/etc/rc.d/openvpn start|stop<br />
<ul>
<li><i>Instruccion GNU/Linux</i></li>
</ul>
PENDIENTE<br />
<ul>
<li><i>Instruccion OS X</i></li>
</ul>
<b>Para configurar</b><br />
Finder / Applications / Utilities / Terminal <br />
$ mkdir -p ~/Library/Application\ Support/Tunnelblick/Configurations/blackvpn.tblk/Contents/Resources/<br />
$ touch ~/Library/Application\ Support/Tunnelblick/Configurations/blackvpn.tblk/Contents/Resources/config.ovpn<br />
$ vi ~/Library/Application\ Support/Tunnelblick/Configurations/blackvpn.tblk/Contents/Resources/config.ovpn<br />
tecla i para poder editar<br />
pegar el contenido del archivo .ovpn<br />
salir del editor vi (Esc :wq)<br />
<b>Para conectar</b><br />
<i>Finder / Application / Tunnelblick</i><br />
<i>esto pone un icono en la parte superior derecha (junto a la hora), dar click<br />Connect blackvpn</i><br />
<ul>
<li><i>Instruccion Windows</i></li>
</ul>
<ul>
</ul>
<b>Para configurar</b><br />
Al instalar OpenVPN en Windows, busque en conexiones de red una
conexion nueva llamada 'Conexion de area local N' que debemos renombrar a 'openvpn', para identificarla mire la que en sus propiedades dice Conectar usando:
'TAP-Windows Adapter V9'<b> </b><br />
Meta ambos archivos blackvpn_usa.ovpn y auth.txt en la carpeta del
programa openvpn, por ejemplo en el caso de Windows 7 a 64-bit la ruta es C:\Program Files (x86)\OpenVPN\config\<br />
En el archivo blackvpn_usa.ovpn verifique la ruta al archivo auth.txt<br />
auth-user-pass "C:\\Program Files (x86)\\OpenVPN\\config\\auth.txt"<br />
<b>Para conectar</b><br />
Inicio / Todos los programas / OpenVPN / OpenVPN GUI<br />
esto pone un icono en la parte inferior derecha (junto a la hora), dar click derecho en el y conectarAngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com0tag:blogger.com,1999:blog-6410840638905218654.post-80631342172511741852013-10-11T10:58:00.002-05:002013-11-07T15:26:54.452-05:00VSFTPDIntroducion:<br />
<br />
Instalar VSFTPD en FreeBSD<br />
En nuestro caso el servicio permitira subir archivos mediante un usuario y clave, pero no permitira conexiones anonimas. <br />
<br />
Requerimientos:<br />
<br />
* Conexion a Internet<br />
* FreeBSD instalado<br />
* Leer este manual<br />
<br />
El proceso:<br />
<br />
Actualizar el arbol de ports<br />
<br />
(ya se debe hacer mediante portsnap)<br />
<br />
Instalar el port de VSFTPD<br />
<br />
# whereis vsftpd<br />
vsftpd: /usr/ports/ftp/vsftpd<br />
# cd /usr/ports/ftp/vsftpd<br />
# make install clean<br />
...<br />
===> Registering installation for vsftpd-3.0.2<br />
<br />
El contenidos de los archivos es:<br />
<br />
# egrep -v '#|^ *$' /usr/local/etc/vsftpd.conf<br />
<br />
anonymous_enable=NO<br />
local_enable=YES<br />
write_enable=YES<br />
local_umask=022<br />
dirmessage_enable=YES<br />
xferlog_enable=YES<br />
connect_from_port_20=YES<br />
ftpd_banner=Welcome to Alpha FTP service.<br />
chroot_local_user=YES<br />
listen=YES<br />
secure_chroot_dir=/usr/local/share/vsftpd/empty<br />
background=YES<br />
pasv_min_port=49152<br />
pasv_max_port=65535<br />
<br />
Para que el servicio inicie con el servidor<br />
<br />
# edit /etc/rc.conf<br />
<br />
Agregar<br />
<br />
vsftpd_enable="YES"<br />
<br />
Iniciar el servicio<br />
<br />
# /usr/local/etc/rc.d/vsftpd start<br />
<br />
Crear el usuario para las transferencias<br />
<br />
# adduser<br />
Username: invitadoftp<br />
Full name: invitadoftp<br />
Uid (Leave empty for default): <br />
Login group [invitadoftp]: <br />
Login group is invitadoftp. Invite invitadoftp into other groups? []: <br />
Login class [default]: <br />
Shell (sh csh tcsh nologin) [sh]: nologin<br />
Home directory [/home/invitadoftp]: <br />
Home directory permissions (Leave empty for default): <br />
Use password-based authentication? [yes]: <br />
Use an empty password? (yes/no) [no]: <br />
Use a random password? (yes/no) [no]: <br />
Enter password: <br />
Enter password again: <br />
Lock out the account after creation? [no]: <br />
Username : invitadoftp<br />
Password : laclavesecreta<br />
Full Name : invitadoftp<br />
Uid : 1120<br />
Class : <br />
Groups : invitadoftp <br />
Home : /home/invitadoftp<br />
Home Mode : <br />
Shell : /usr/sbin/nologin<br />
Locked : no<br />
OK? (yes/no): yes<br />
adduser: INFO: Successfully added (invitadoftp) to the user database.<br />
Add another user? (yes/no): no<br />
Goodbye!<br />
<br />
Asignar el directorio creado al usuario root<br />
<br />
# chown root /home/invitadoftp<br />
<br />
Quitarle el permiso de escribir al usuario<br />
<br />
# chmod -w /home/invitadoftp<br />
<br />
Crear un directorio llamado pub dentro<br />
<br />
# mkdir /home/invitadoftp/pub<br />
<br />
Darle permisos de escritura en el directorio pub<br />
<br />
# chmod -R 777 /home/invitadoftp/pub<br />
<br />
En el firewall hay que abrir los puertos necesarios, un ejemplo para PF (en nuestro caso estamos abriendo el puerto 21 y un rango desde 49152 hasta 65535)<br />
<br />
# PF "Self-Protecting" an FTP Server (passive)<br />
pass in on $ext_if proto tcp from any to any port { ftp, > 49151 } \<br />
keep state<br />
<br />
Para verificar que nuestro servidor ftp funciona, lo podemos hacer de dos formas:<br />
<br />
Ejemplo 1<br />
En el mismo servidor usando el Shell Unix <br />
$ ftp invitadoftp@localhost<br />
...<br />
<br />
Ejemplo 2<br />
Desde otro equipo hacia el servidor por Internet, ejemplo desde un Shell Unix (en el caso de que tenga algun *unix)<br />
<br />
$ ftp invitadoftp@IPDELSERVIDOR<br />
Connected to IPDELSERVIDOR.<br />
220 Welcome to Alpha FTP service.<br />
331 Please specify the password.<br />
Password: laclavesecreta<br />
230 Login successful.<br />
Remote system type is UNIX.<br />
Using binary mode to transfer files.<br />
ftp> ls<br />
229 Entering Extended Passive Mode (|||54611|).<br />
150 Here comes the directory listing.<br />
drwxrwxrwx 2 1010 1010 97 Oct 21 15:50 pub<br />
226 Directory send OK.<br />
ftp> quit<br />
221 Goodbye.<br />
$ <br />
<br />
Continuando con el ejemplo 2, si este equipo tiene un Windows, desde el DOS<br />
<br />
C:\>ftp IPDELSERVIDOR<br />
<br />
Si queremos que el directorio no tenga archivos o carpetas con mas de 7 dias<br />
<br />
Creamos un script<br />
<br />
# edit /usr/home/backups/scripts/script-del-old.sh<br />
<br />
que se veria asi, use este comando para verlo # cat /usr/home/backups/scripts/script-del-old.sh<br />
<br />
#! /bin/sh<br />
<br />
# Archivos<br />
find /usr/home/invitadoftp/pub -type f -mtime +1w -exec rm {} \;<br />
<br />
# Carpetas (indispensable la opcion "-depth 1" o borrara pub si esta vacia)<br />
find /usr/home/invitadoftp/pub -depth 1 -type d -empty -mtime +1w -exec rmdir {} \;<br />
<br />
Le damos permisos de ejecucion<br />
<br />
# chmod +x /usr/home/backups/scripts/script-del-old.sh<br />
<br />
Y en cron ponemos la linea<br />
<br />
00 01 * * * root /usr/home/backups/scripts/script-del-old.sh<br />
<br />
Con esto ejecutamos diariamente una busqueda todos los dias a las 01 de la manana de los<br />
archivos y carpetas vacias de mas de una semana o 7 dias y los borramos.<br />
<br />
Otro ejemplo aun mas elaborado del script seria asi, use este comando para verlo # cat /usr/home/backups/scripts/script-del-old.sh<br />
<br />
#! /bin/sh<br />
<br />
# Archivos<br />
find /usr/home/invitadoftp/pub -type f -mtime +1w > /tmp/listfiles.txt<br />
rm `cat /tmp/listfiles.txt`<br />
mail -s "Archivos borrados del FTP" login@gmail.com < /tmp/listfiles.txt<br />
rm /tmp/listfiles.txt<br />
<br />
# Carpetas<br />
find /usr/home/invitadoftp/pub -depth 1 -type d -empty -mtime +1w > /tmp/listdirectories.txt<br />
rmdir `cat /tmp/listdiries.txt`<br />
mail -s "Carpetas borradas del FTP" login@gmail.com < /tmp/listdiries.txt<br />
rm /tmp/listdiries.txtAngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com0tag:blogger.com,1999:blog-6410840638905218654.post-80915594028285261632013-03-06T16:52:00.000-05:002013-04-30T07:46:14.328-05:00Migrar de CVSup/csup a portsnapTradicionalmente se usaba csup en un comando como este<br />
<br />
# csup -h cvsup15.us.FreeBSD.org -g -L 2 /usr/share/examples/cvsup/ports-supfile<br />
<br />
para mantener actualizado nuestro arbol de ports en FreeBSD, pero se anuncia que por el 28 de Febrero del 2013, se migrara de CVS, CVsup y csup al nuevo portsnap.<br />
<br />
Para migrar en los FreeBSD que ya teniamos nuestro arbol de ports de la forma antigua...<br />
<br />
Cuando hemos instalado una gran cantidad de ports, el directorio /usr/ports/distfiles esta lleno de archivos fuentes que no queremos perder, le hacemos una copia<br />
<br />
# cp -r /usr/ports/distfiles /home/<br />
# cp -r /usr/ports/packages /home/<br />
<br />
Ahora borraremos el viejo arbol de ports<br />
<br />
# rm -rf /usr/ports<br />
<br />
Ya podemos iniciar trabajo con portsnap<br />
<br />
La primera vez que vamos a usar portsnap hay que descargar un snapshot del arbol de ports y descomprimirlo en /usr/ports<br />
<br />
# portsnap fetch extract<br />
<br />
Luego para mantener nuestro arbol de ports actualizado, se ejecuta el comando<br />
<br />
# portsnap fetch update<br />
<br />
El Handbook <br />
<a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html">http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html</a>, y mas especificamente en <a href="http://www.freebsd.org/cgi/man.cgi?query=portsnap&amp;sektion=8">http://www.freebsd.org/cgi/man.cgi?query=portsnap&amp;sektion=8</a> dice que se debe poner la linea asi:<br />
<br />
00 06 * * * root /usr/sbin/portsnap cron<br />
<br />
Pero no me hace nada!<br />
<br />
Otro sitio <a href="https://bitdrop.st0w.com/2009/05/18/setting-up-a-new-freebsd-server-for-easy-maintenance">https://bitdrop.st0w.com/2009/05/18/setting-up-a-new-freebsd-server-for-easy-maintenance</a> recomienda que es mejor con otros datos, pero tampoco funciona.<br />
<br />
00 06 * * * root /usr/sbin/portsnap update cron<br />
<br />
Y esta ultima si funciona!<br />
<br />
Por ultimo tenemos que volver a copiar nuestra carpeta distfiles que copiamos en /home y borrarla al terminar<br />
<br />
# cp -r /home/distfiles /usr/ports/<br />
# cp -r /home/packages /usr/ports/<br />
# rm -rf /home/distfiles<br />
# rm -rf /home/packages<br />
<br />AngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com0tag:blogger.com,1999:blog-6410840638905218654.post-85503791674524555702013-03-04T17:27:00.002-05:002013-04-03T17:13:55.473-05:00Samba4 AD/DCEscenario:<br />
FreeBSD 9.1 + Samba 4 (Bind99, SAMBA_INTERNAL) + Bind99 (actualizado desde el DHCP) + DHCP<br />
<br />
Resultado:<br />
Funciona!<br />
<br />
Manuales consultados:<br />
http://wiki.samba.org/index.php/Samba_AD_DC_HOWTO<br />
http://www.whitneytechnologies.com/?p=422<br />
http://fraterneo.blogspot.com/2012/12/como-configurar-un-controlador-de.html<br />
http://www.freebsd.org/doc/handbook/kerberos5.html<br />
http://www.rjsystems.nl/en/2100-dns-discovery-kerberos.php<br />
http://es.wikipedia.org/wiki/Kerberos<br />
http://www.bind9.net/manuals<br />
http://albertolarripa.com/?p=1530<br />
http://www.semicomplete.com/articles/dynamic-dns-with-dhcp<br />
http://forums.freebsd.org/showthread.php?t=33849<br />
http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/DNSDHCP.html<br />
http://lani78.wordpress.com/2012/07/23/make-your-dhcp-server-dynamically-update-your-dns-records-on-ubuntu-12-04-precise-pangolin<br />
<br />
Parametros de red:<br />
hostname="samdom.example.com"<br />
keymap="spanish.iso.kbd"<br />
#ifconfig_em0="DHCP"<br />
ifconfig_em0="inet 192.168.2.101 netmask 255.255.255.0"<br />
defaultrouter="192.168.2.1"<br />
ifconfig_em1="inet 192.168.1.1 netmask 255.255.255.0"<br />
ipv6_activate_all_interfaces="YES"<br />
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable<br />
dumpdev="AUTO"<br />
sshd_enable="YES"<br />
<br />
Particionado del disco SATA:<br />
ada0 931GB GPT<br />
ada0p1 512kB freebsd-boot<br />
ada0p2 16GB freebsd-ufs / exrootfs<br />
ada0p3 32GB freebsd-swap none exswap<br />
ada0p4 64GB freebsd-ufs /var exvarfs<br />
ada0p5 16GB freebsd-ufs /tmp extmpfs<br />
ada0p6 803GB freebsd-ufs /usr exusrfs<br />
<br />
Claves en el FreeBSD:<br />
root / 123<br />
<br />
PORTS<br />
Descargar el arbol de ports "fetch", se descomprime "extract" (se ejecuta la primera vez)<br />
# portsnap fetch extract<br />
<br />
Ahora para manterner el arbol de ports actualizado, se ejecuta siempre<br />
# portsnap fetch update<br />
<br />
Esta ultima linea se puede agregar al cron para que diario actualice los ports, en /etc/crontab se agrega una linea como esta<br />
00 06 * * * root /usr/sbin/portsnap fetch update >/dev/null 2>&1<br />
<br />
ACLS<br />
# cat /etc/fstab<br />
# Device Mountpoint FStype Options Dump Pass#<br />
/dev/ada0p2 / ufs rw 1 1<br />
/dev/ada0p3 none swap sw 0 0<br />
/dev/ada0p4 /var ufs rw 2 2<br />
/dev/ada0p5 /tmp ufs rw 2 2<br />
/dev/ada0p6 /usr ufs rw 2 2<br />
<br />
# cat /etc/fstab<br />
# Device Mountpoint FStype Options Dump Pass#<br />
/dev/ada0p2 / ufs rw,acls 1 1<br />
/dev/ada0p3 none swap sw 0 0<br />
/dev/ada0p4 /var ufs rw,acls 2 2<br />
/dev/ada0p5 /tmp ufs rw,acls 2 2<br />
/dev/ada0p6 /usr ufs rw,acls 2 2<br />
<br />
# reboot<br />
<br />
Configurar las opciones de Bind99<br />
# cd /usr/ports/dns/bind99<br />
# make config<br />
<br />
Options for bind99 9.9.2.1<br />
<br />
[ ] FIXED_RRSET Enable fixed rrset ordering<br />
[ ] IDN International Domain Names<br />
[*] IPV6 IPv6 protocol<br />
[ ] LARGE_FILE 64-bit file support<br />
[*] LINKS Create conf file symlinks in /usr/local<br />
[*] REPLACE_BASE Replace base BIND with this version <-MARCAR ESTA OPCION!<br />
[ ] RPZRRL_PATCH RPZ improvements + RRL patch (experimental)<br />
[ ] RPZ_NSDNAME Enable RPZ NSDNAME policy records<br />
[ ] RPZ_NSIP Enable RPZ NSIP trigger rules<br />
[ ] SIGCHASE dig/host/nslookup will do DNSSEC validation<br />
[*] SSL Build with OpenSSL (Required for DNSSEC)<br />
[*] THREADS Threading support<br />
[*] XML Support for xml statistics output<br />
[ ] DLZ_POSTGRESQL G(DLZ): DLZ Postgres driver<br />
[ ] DLZ_POSTGRESQL G(DLZ): DLZ Postgres driver<br />
[ ] DLZ_MYSQL G(DLZ): DLZ MySQL driver (no threading)<br />
[ ] DLZ_BDB G(DLZ): DLZ BDB driver<br />
[ ] DLZ_LDAP G(DLZ): DLZ LDAP driver<br />
[ ] DLZ_FILESYSTEM G(DLZ): DLZ filesystem driver<br />
[ ] DLZ_STUB G(DLZ): DLZ stub driver<br />
<br />
< OK ><br />
<br />
Instalar Samba4<br />
# cd /usr/ports/net/samba4<br />
# make config<br />
<br />
Options for samba4 4.0.3<br />
[*] ACL_SUPPORT File system ACL support<br />
[*] ADS Active Directory support<br />
[*] AIO_SUPPORT Asyncronous IO support<br />
[ ] AVAHI Zeroconf via Avahi <- DESACTIVAR ESTA OPCION!<br />
[*] CUPS CUPS printing system<br />
[*] DEBUG With debug information in the binaries<br />
[ ] DEVELOPER With development support<br />
[*] DNSUPDATE Dynamic DNS update(require ADS)<br />
[ ] EXP_MODULES Experimental modules<br />
[*] FAM_SUPPORT File Alteration Monitor support<br />
[*] LDAP LDAP support<br />
[ ] MANPAGES Build and/or install manual pages<br />
[*] PAM_SMBPASS PAM authentication via passdb backends<br />
[*] PTHREADPOOL Pthread pool<br />
[*] QUOTAS Disk quota support<br />
[*] SWAT SWAT WebGUI<br />
[*] SYSLOG Syslog support<br />
[*] UTMP UTMP accounting support<br />
[*] WINBIND WinBIND support<br />
[ ] NSUPDATE S(DNS): Use internal DNS with NSUPDATE utility <- DESACTIVAR ESTA OPCION!<br />
[ ] BIND98 S(DNS): Use bind98 as a DNS server frontend<br />
[*] BIND99 S(DNS): Use bind99 as a DNS server frontend <- MARCAR ESTA OPCION!<br />
<br />
< OK ><br />
<br />
# make config-recursive<br />
(todos los otros ports los dejo por defecto)<br />
<br />
# make install clean<br />
<br />
Nota:<br />
El port de Samba4 con la opcion [*] BIND99 instalara bind99, por eso<br />
primero configuramos las opciones<br />
de bind99 [*] REPLACE_BASE<br />
<br />
# rndc-confgen -a -c /etc/namedb/rndc.conf -k rndc-key -b 256<br />
wrote key file "/etc/namedb/rndc.conf"<br />
<br />
# cat /etc/namedb/rndc.conf<br />
key "rndc-key" {<br />
algorithm hmac-md5;<br />
secret "zvuOE1XeVBUXZa12LTUDEAgZaH3cVFZp+GiObzuAB5c=";<br />
};<br />
<br />
# edit /etc/namedb/named.conf<br />
<br />
options {<br />
// All file and path names are relative to the chroot directory,<br />
// if any, and should be fully qualified.<br />
directory "/etc/namedb/working";<br />
pid-file "/var/run/named/pid";<br />
dump-file "/var/dump/named_dump.db";<br />
statistics-file "/var/stats/named.stats";<br />
...<br />
listen-on { 127.0.0.1; 192.168.1.1; };<br />
...<br />
forwarders {<br />
8.8.8.8;<br />
8.8.4.4;<br />
};<br />
...<br />
//zone "example.com" { type master; file "/etc/namedb/master/empty.db"; }; <- COMENTAR ESTA LINEA!<br />
...<br />
controls {<br />
inet 127.0.0.1 allow { localhost; } keys { rndc-key; };<br />
};<br />
<br />
// Take this from the /etc/namedb/rndc.conf file<br />
key "rndc-key" {<br />
algorithm hmac-md5;<br />
secret "zvuOE1XeVBUXZa12LTUDEAgZaH3cVFZp+GiObzuAB5c=";<br />
};<br />
<br />
zone "example.com" {<br />
type master;<br />
allow-update { key "rndc-key"; };<br />
allow-transfer { localhost; 192.168.1.1; };<br />
file "/etc/namedb/dynamic/example.com";<br />
};<br />
<br />
zone "1.168.192.in-addr.arpa" {<br />
type master;<br />
allow-update { key "rndc-key"; };<br />
allow-transfer { localhost; 192.168.1.1; };<br />
file "/etc/namedb/dynamic/1.168.192.in-addr.arpa";<br />
};<br />
<br />
# edit /etc/namedb/dynamic/example.com<br />
<br />
$TTL 3600 ; 1 hour default TTL<br />
example.com. IN SOA samdom.example.com. admin.example.com. (<br />
2013021701 ; Serial<br />
10800 ; Refresh (3 hours)<br />
3600 ; Retry (1 hour)<br />
604800 ; Expire (1 week)<br />
300 ; Negative Response TTL (5 minutes)<br />
)<br />
; DNS Servers<br />
IN NS samdom.example.com. <br />
; MX Records <br />
;IN MX 10 mx.example.com. <br />
;IN MX 20 mail.example.com. <br />
IN A 192.168.1.1 <br />
; Machine Names <br />
localhost IN A 127.0.0.1 <br />
samdom IN A 192.168.1.1 <br />
kerberos IN A 192.168.1.1 <br />
ldap IN A 192.168.1.1 <br />
; Aliases <br />
; <br />
;_kerberos._udp IN SRV 01 00 88 kerberos.example.com. <br />
;_kerberos._tcp IN SRV 01 00 88 kerberos.example.com.<br />
;_kpasswd._udp IN SRV 01 00 464 kerberos.example.com.<br />
;_kerberos-adm._tcp IN SRV 01 00 749 kerberos.example.com.<br />
;_kerberos IN TXT EXAMPLE.COM<br />
;<br />
;_ldap._tcp IN SRV 01 00 389 ldap.example.com.<br />
;_ldap._udp IN SRV 01 00 88 ldap.example.com.<br />
<br />
¡Atencion!<br />
Aunque las entradas son correctas para _kerberos y _ldap, como Samba usa sus propios pero consulta a Bind, si las dejo activas causan problemas.<br />
<br />
# edit /etc/namedb/dynamic/1.168.192.in-addr.arpa<br />
<br />
$TTL 3600 ; 1 hour default TTL<br />
1.168.192.in-addr.arpa. IN SOA samdom.example.com. admin.example.com. (<br />
2013021701 ; Serial<br />
10800 ; Refresh (3 hours)<br />
3600 ; Retry (1 hour)<br />
604800 ; Expire (1 week)<br />
300 ; Negative Response TTL (5 minutes)<br />
)<br />
; DNS Servers <br />
IN NS samdom.example.com. <br />
; Machine IPs <br />
1 IN PTR samdom.example.com. <br />
1 IN PTR kerberos.example.com.<br />
<br />
# edit /etc/rc.conf<br />
<br />
# Bind<br />
named_enable="YES"<br />
named_chrootdir=""<br />
<br />
# /etc/rc.d/named start<br />
<br />
# edit /etc/resolv.conf<br />
<br />
search example.com<br />
domain EXAMPLE.COM<br />
nameserver 127.0.0.1<br />
#nameserver 8.8.8.8<br />
#nameserver 8.8.4.4<br />
<br />
# nslookup samdom<br />
Server: 127.0.0.1<br />
Address: 127.0.0.1#53<br />
<br />
Name: samdom.example.com<br />
Address: 192.168.1.1<br />
<br />
# nslookup kerberos<br />
Server: 127.0.0.1<br />
Address: 127.0.0.1#53<br />
<br />
Name: kerberos.example.com<br />
Address: 192.168.1.1<br />
<br />
Instalar isc-dhcp42-server<br />
# cd /usr/ports/net/isc-dhcp42-server<br />
<br />
# make config<br />
<br />
Options for isc-dhcp42-server 4.2.4_2<br />
<br />
[ ] BIND_SYMBOLS Enable BIND internal symbol table<br />
[*] IPV6 IPv6 protocol<br />
[ ] LDAP LDAP support<br />
[*] LDAP_SSL Support LDAP over SSL/TLS<br />
[ ] PARANOIA Enable support for chroot<br />
<br />
< OK ><br />
<br />
# make config-recursive<br />
# make install clean<br />
<br />
# rm /usr/local/etc/dhcpd.conf<br />
# edit /usr/local/etc/dhcpd.conf<br />
<br />
# dhcpd.conf<br />
#<br />
# Sample configuration file for ISC dhcpd PRIMARY<br />
#<br />
<br />
option domain-name "example.com";<br />
option domain-name-servers 192.168.1.1;<br />
default-lease-time 600;<br />
max-lease-time 7200;<br />
<br />
# If this DHCP server is the official DHCP server for the local<br />
# network, the authoritative directive should be uncommented.<br />
authoritative;<br />
<br />
# ad-hoc DNS update scheme - set to "none" to disable dynamic DNS updates.<br />
ddns-updates on;<br />
ddns-update-style interim;<br />
ddns-domainname "example.com";<br />
allow client-updates;<br />
<br />
# Take this from the /etc/namedb/rndc.conf file<br />
key "rndc-key" {<br />
algorithm hmac-md5;<br />
secret "zvuOE1XeVBUXZa12LTUDEAgZaH3cVFZp+GiObzuAB5c=";<br />
}<br />
<br />
zone example.com. {<br />
primary 192.168.1.1;<br />
key rndc-key;<br />
}<br />
<br />
zone 1.168.192.in-addr.arpa. {<br />
primary 192.168.1.1;<br />
key rndc-key;<br />
}<br />
<br />
# Use this to send dhcp log messages to a different log file (you also<br />
# have to hack syslog.conf to complete the redirection).<br />
log-facility local7;<br />
<br />
option netbios-name-servers 192.168.1.1;<br />
option netbios-node-type 8;<br />
option time-offset -18000; # Bogota GMT -5.0 Hours => -5x60x60 = -18000 Seconds<br />
option ntp-servers 192.168.1.1;<br />
option time-servers 192.168.1.1;<br />
<br />
# Dinamics<br />
subnet 192.168.1.0 netmask 255.255.255.0 {<br />
range 192.168.1.10 192.168.1.110;<br />
option routers 192.168.1.1;<br />
option broadcast-address 192.168.1.255;<br />
}<br />
<br />
# ifconfig em1 inet 192.168.1.1 netmask 255.255.255.0 up<br />
<br />
# edit /etc/rc.conf<br />
<br />
ifconfig_em1=" inet 192.168.1.1 netmask 255.255.255.0"<br />
<br />
# DHCP Server<br />
dhcpd_enable="YES"<br />
dhcpd_flags="-q"<br />
dhcpd_conf="/usr/local/etc/dhcpd.conf"<br />
dhcpd_ifaces="em1"<br />
dhcpd_withumask="022"<br />
<br />
# /usr/local/etc/rc.d/isc-dhcpd start<br />
<br />
Instalar cups-base<br />
# cd /usr/ports/print/cups-base<br />
<br />
# make config<br />
Dejo todo por defecto<br />
<br />
# make config-recursive<br />
Dejo todo por defecto<br />
<br />
# make install clean<br />
<br />
# edit /etc/rc.conf<br />
<br />
# CUPS<br />
cupsd_enable="YES"<br />
<br />
# /usr/local/etc/rc.d/cupsd start<br />
<br />
Editamos el archivo y le agregamos la parte "options"<br />
# edit /etc/namedb/rndc.conf<br />
<br />
key "rndc-key" {<br />
algorithm hmac-md5;<br />
secret "zvuOE1XeVBUXZa12LTUDEAgZaH3cVFZp+GiObzuAB5c=";<br />
};<br />
<br />
options {<br />
default-server 127.0.0.1;<br />
default-key rndc-key;<br />
};<br />
<br />
# rndc status<br />
version: 9.9.2-P1<br />
CPUs found: 2<br />
worker threads: 2<br />
UDP listeners per interface: 2<br />
number of zones: 99<br />
debug level: 0<br />
xfers running: 0<br />
xfers deferred: 0<br />
soa queries in progress: 0<br />
query logging is OFF<br />
recursive clients: 0/0/1000<br />
tcp clients: 0/100<br />
server is up and running<br />
<br />
# /usr/local/bin/samba-tool domain provision<br />
Realm [EXAMPLE.COM]: EXAMPLE.COM<br />
Domain [EXAMPLE]: EXAMPLE<br />
Server Role (dc, member, standalone) [dc]: dc<br />
DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]: SAMBA_INTERNAL<br />
DNS forwarder IP address (write 'none' to disable forwarding) [127.0.0.1]: 192.168.1.1<br />
Administrator password:<br />
Retype password:<br />
Looking up IPv4 addresses<br />
More than one IPv4 address found. Using 192.168.1.1<br />
Looking up IPv6 addresses<br />
No IPv6 address will be assigned<br />
Setting up share.ldb<br />
Setting up secrets.ldb<br />
Setting up the registry<br />
Setting up the privileges database<br />
Setting up idmap db<br />
Setting up SAM db<br />
Setting up sam.ldb partitions and settings<br />
Setting up sam.ldb rootDSE<br />
Pre-loading the Samba 4 and AD schema<br />
Adding DomainDN: DC=example,DC=com<br />
Adding configuration container<br />
Setting up sam.ldb schema<br />
Setting up sam.ldb configuration data<br />
Setting up display specifiers<br />
Modifying display specifiers<br />
Adding users container<br />
Modifying users container<br />
Adding computers container<br />
Modifying computers container<br />
Setting up sam.ldb data<br />
Setting up well known security principals<br />
Setting up sam.ldb users and groups<br />
Setting up self join<br />
Adding DNS accounts<br />
Creating CN=MicrosoftDNS,CN=System,DC=example,DC=com<br />
Creating DomainDnsZones and ForestDnsZones partitions<br />
Populating DomainDnsZones and ForestDnsZones partitions<br />
Setting up sam.ldb rootDSE marking as synchronized<br />
Fixing provision GUIDs<br />
A Kerberos configuration suitable for Samba 4 has been generated at /var/db/samba4/private/krb5.conf<br />
Once the above files are installed, your Samba4 server will be ready to use<br />
Server Role: active directory domain controller<br />
Hostname: samdom<br />
NetBIOS Domain: EXAMPLE<br />
DNS Domain: example.com<br />
DOMAIN SID: S-1-5-21-3981277467-4260322419-4091201666<br />
<br />
# cp /var/db/samba4/private/krb5.conf /etc/<br />
# cat /etc/krb5.conf<br />
<br />
[libdefaults]<br />
default_realm = EXAMPLE.COM<br />
dns_lookup_realm = false<br />
dns_lookup_kdc = true<br />
<br />
# edit /etc/rc.conf<br />
<br />
# NTP<br />
ntpd_enable="YES"<br />
ntpd_config="/etc/ntp.conf"<br />
<br />
# edit /etc/ntp.conf<br />
<br />
server 0.pool.ntp.org prefer<br />
server 1.pool.ntp.org<br />
server 2.pool.ntp.org<br />
server 3.pool.ntp.org<br />
driftfile /var/db/ntp.drift<br />
<br />
# /etc/rc.d/ntpd start<br />
Starting ntpd.<br />
<br />
# edit /etc/rc.conf<br />
<br />
# Samba4<br />
samba4_enable="YES"<br />
samba4_config="/usr/local/etc/smb4.conf"<br />
winbindd_enable="YES"<br />
<br />
# testparm /usr/local/etc/smb4.conf<br />
Load smb config files from /usr/local/etc/smb4.conf<br />
max_open_files: increasing sysctl_max (11095) to minimum Windows limit (16384)<br />
rlimit_max: increasing rlimit_max (11095) to minimum Windows limit (16384)<br />
Processing section "[netlogon]"<br />
Processing section "[sysvol]"<br />
Loaded services file OK.<br />
Server role: ROLE_ACTIVE_DIRECTORY_DC<br />
Press enter to see a dump of your service definitions<br />
<br />
[global]<br />
workgroup =EXAMPLE<br />
realm = example.com<br />
server role = active directory domain controller<br />
passdb backend = samba_dsdb<br />
dns forwarder = 192.168.1.1<br />
rpc_server:tcpip = no<br />
rpc_daemon:spoolssd = embedded<br />
rpc_server:spoolss = embedded<br />
rpc_server:winreg = embedded<br />
rpc_server:ntsvcs = embedded<br />
rpc_server:eventlog = embedded<br />
rpc_server:srvsvc = embedded<br />
rpc_server:svcctl = embedded<br />
rpc_server:default = external<br />
idmap config * : backend = tdb<br />
create mask = 0777<br />
directory mask = 0777<br />
map archive = No<br />
map readonly = no<br />
store dos attributes = Yes<br />
vfs objects = dfs_samba4, acl_xattr<br />
<br />
[netlogon]<br />
path = /var/db/samba4/sysvol/example.com/scripts<br />
read only = No<br />
<br />
[sysvol]<br />
path = /var/db/samba4/sysvol<br />
read only = No<br />
<br />
Para solucionar el error de<br />
max_open_files: increasing sysctl_max (11095) to minimum Windows limit (16384)<br />
rlimit_max: increasing rlimit_max (11095) to minimum Windows limit (16384)<br />
<br />
# edit /boot/loader.conf<br />
<br />
# Samba<br />
kern.maxfiles="20480"<br />
<br />
ESTE PASO ES IMPORTANTISIMO, SI NO SE EJECUTA NO ENTRAREMOS AL DOMINIO DESDE LOS CLIENTES!<br />
# /usr/local/sbin/samba4 -i -M single -d 4 &<br />
<br />
# killall samba4<br />
<br />
# /usr/local/etc/rc.d/samba4 start<br />
<br />
# kinit administrator@EXAMPLE.COM<br />
administrator@example.com's Password: miclave123<br />
<br />
# klist<br />
Credentials cache: FILE:/tmp/krb5cc_0<br />
Principal: administrator@EXAMPLE.COM<br />
<br />
Issued Expires Principal<br />
Feb 24 02:13:50 Feb 24 12:13:50 krbtgt/EXAMPLE.COM@EXAMPLE.COM<br />
<br />
# net rpc join -S samdom -Uadministrator<br />
Enter administrator's password: miclave123<br />
Joined domain EXAMPLE.<br />
<br />
# smbclient -L localhost -U%<br />
Domain=[EXAMPLE] OS=[Unix] Server=[Samba 4.0.3]<br />
<br />
Sharename Type Comment<br />
--------- ---- -------<br />
netlogon Disk<br />
sysvol Disk<br />
IPC$ IPC IPC Service (Samba 4.0.3)<br />
Domain=[EXAMPLE] OS=[Unix] Server=[Samba 4.0.3]<br />
<br />
Server Comment<br />
--------- -------<br />
<br />
Workgroup Master<br />
--------- -------<br />
<br />
# /usr/local/bin/smbclient //localhost/netlogon -UAdministrator'' -c 'ls'<br />
Enter Administrator's password: miclave123<br />
Domain=[EXAMPLE] OS=[Unix] Server=[Samba 4.0.3]<br />
. D 0 Sun Feb 24 02:01:16 2013<br />
.. D 0 Sun Feb 24 02:01:23 2013<br />
<br />
63332 blocks of size 65536. 54255 blocks available<br />
<br />
# samba-tool dns query 127.0.0.1 example.com @ ALL<br />
Password for [administrator@EXAMPLE.COM]:<br />
Name=, Records=4, Children=0<br />
SOA: serial=1, refresh=900, retry=600, expire=86400, ns=samdom.example.com., email=hostmaster.example.com. (flags=600000f0, serial=1, ttl=3600)<br />
NS: samdom.example.com. (flags=600000f0, serial=1, ttl=900)<br />
A: 192.168.1.1 (flags=600000f0, serial=1, ttl=900)<br />
A: 192.168.2.101 (flags=600000f0, serial=110, ttl=900)<br />
Name=_msdcs, Records=0, Children=0<br />
Name=_sites, Records=0, Children=1<br />
Name=_tcp, Records=0, Children=4<br />
Name=_udp, Records=0, Children=2<br />
Name=DomainDnsZones, Records=0, Children=2<br />
Name=ForestDnsZones, Records=0, Children=2<br />
Name=samdom, Records=2, Children=0<br />
A: 192.168.1.1 (flags=f0, serial=1, ttl=900)<br />
A: 192.168.2.101 (flags=f0, serial=110, ttl=900)<br />
<br />
# wbinfo -u<br />
Administrator<br />
Guest<br />
krbtgt<br />
<br />
# wbinfo -g<br />
Enterprise Read-Only Domain Controllers<br />
Domain Admins<br />
Domain Users<br />
Domain Guests<br />
Domain Computers<br />
Domain Controllers<br />
Schema Admins<br />
Enterprise Admins<br />
Group Policy Creator Owners<br />
Read-Only Domain Controllers<br />
DnsUpdateProxy<br />
<br />
TEST DNS<br />
# host -t SRV _ldap._tcp.example.com<br />
_ldap._tcp.example.com has SRV record 0 100 389 samdom.example.com.<br />
<br />
# host -t SRV _ldap._tcp.example.com<br />
_ldap._tcp.example.com has SRV record 0 100 389 samdom.example.com.<br />
<br />
# host -t A ldap.example.com<br />
ldap.example.com has address 192.168.1.1<br />
<br />
# host -t SRV _kerberos._tcp.example.com<br />
_kerberos._tcp.example.com has SRV record 1 0 88 kerberos.example.com.<br />
<br />
# host -t SRV _kerberos._udp.example.com<br />
_kerberos._udp.example.com has SRV record 1 0 88 kerberos.example.com.<br />
<br />
# host -t SRV _kpasswd._udp.example.com<br />
_kpasswd._udp.example.com has SRV record 1 0 464 kerberos.example.com.<br />
<br />
# host -t SRV _kerberos-adm._tcp.example.com<br />
_kerberos-adm._tcp.example.com has SRV record 1 0 749 kerberos.example.com.<br />
¡Atencion!<br />
Al inactivar las lineas referentes a _kerberos y _ldap las consultas no se resuelven.<br />
<br />
# host -t A samdom.example.com<br />
samdom.example.com has address 192.168.1.1<br />
<br />
Crear un usuario<br />
# samba-tool user add miguel<br />
New Password: miclave123<br />
Retype Password: miclave123<br />
User 'miguel' created successfully<br />
<br />
Verificar el usuario creado<br />
# wbinfo --name-to-sid miguel<br />
S-1-5-21-1013221894-234835428-3392388920-1103 SID_USER (1)<br />
<br />
# reboot<br />
<br />
Compartir impresoras<br />
# edit /usr/local/etc/smb4.conf<br />
<br />
[printers]<br />
comment = All Printers<br />
path = /var/spool/samba<br />
browseable = No<br />
guest ok = Yes<br />
printable = Yes<br />
use client driver = Yes<br />
default devmode = Yes<br />
;show add printer wizard = no # Para no mostrar el asistente de impresoras<br />
<br />
Para que los clientes Windows puedan consultar en el servidor que sirve<br />
las impresoras en busca de drivers, debemos crear el directorio.<br />
# mkdir -p /var/db/samba4/printer-drivers/{COLOR,IA64,W32ALPHA,W32MIPS,W32PPC,W32X86,WIN40,x64}<br />
# edit /usr/local/etc/smb4.conf<br />
<br />
[print$]<br />
comment = Printer Drivers<br />
path = /var/db/samba4/printer-drivers<br />
browseable = yes<br />
guest ok = no<br />
read only = yes<br />
write list = root<br />
<br />
Compartir carpetas y bloquear algunas extensiones peligrosas<br />
# mkdir /home/tmp<br />
# mkdir /home/tmp<br />
# edit /usr/local/etc/smb4.conf<br />
<br />
[tmp]<br />
comment = Temporary file space<br />
path = /home/tmp<br />
valid users = %U<br />
public = no<br />
writable = no<br />
browseable = yes<br />
printable = no<br />
# Las siguientes lineas generan problemas si uso ACLS, dejar inactivas!<br />
# create mask = 0777<br />
# directory mask = 0777<br />
# force create mode = 0777<br />
# force directory mode = 0777<br />
# force user = nobody<br />
# force group = nobody<br />
write list = %U<br />
# Bloqueo de algunos archivos por extencion<br />
veto files = /*.reg/*.com/*.scr/*.cmd/*.exe/*.pif/*.bat/*.{*}/<br />
delete veto files = yes<br />
<br />
Remote Server Administration Tools for Windows 7 with Service Pack 1 (SP1)<br />
http://www.microsoft.com/en-us/download/details.aspx?id=7887<br />
<br />
1 Instalar Remote Server Administration Tools for Windows 7 with Service Pack 1 (SP1)<br />
<br />
2 Inicio / Panel de control / Programas / Activar o desactivar las caracteristicas de Windows<br />
<br />
(se abre ventanita)<br />
<br />
3 - Herramientas de administracion de funciones<br />
- Herramientas de AD DS y AD LDS<br />
- Herramientas de AD DS<br />
* Centro de administracion de Active Directory<br />
* Herramientas de linea de comandos y complementos de AD DS<br />
<br />
4 Aceptar<br />
<br />
5 Wind + R<br />
dsa.msc<br />
<br />
Nota:<br />
Para poder entrar a administrar el dominio mediante el comand dsa.msc, hay que estar logueado como el usuario administrator / miclave123 para poder ver los datos.<br />
<br />
Nota:<br />
Mejor usar # rndc-confgen > /root/dhcp_updater.key<br />
<br />
named.conf<br />
<br />
key "rndc-key" {<br />
algorithm hmac-md5;<br />
secret "+VsrLah1EEr+HKRTGRJyWA==";<br />
};<br />
<br />
controls {<br />
inet 127.0.0.1 port 953<br />
allow { 127.0.0.1; } keys { "rndc-key"; };<br />
}; <br />
<br />
dhcpd.conf<br />
<br />
# Take this from the /etc/namedb/rndc.conf file<br />
key "rndc-key" {<br />
algorithm hmac-md5;<br />
secret "+VsrLah1EEr+HKRTGRJyWA==";<br />
};<br />
<br />
Una nota muy importante en caso de querer editar manualmente los archivos del DNS http://forums.freebsd.org/showthread.php?t=33849<br />
<br />
"Note about editing dynamic zones manually<br /><br />If you have to edit the zone files of dynamic zones manually while the DNS server is running, you’ll have to freeze the zones with # rndc freeze <myzone> before editing and unfreeze them with # rndc thaw <myzone> after editing. This is because named(8) has internal state information and external journal files attached to dynamic zones that have to be kept in sync with the zone files." AngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com2tag:blogger.com,1999:blog-6410840638905218654.post-32996277681823222682013-02-06T09:52:00.000-05:002013-02-06T14:00:51.839-05:00DHCP ServerISC-DHCP Server<br />
<br />
Introduccion:<br />
<br />
Instalar un servidor DHCP para nuestra red LAN con el fin de asignar los parametros de red a los clientes de forma facil.<br />
<br />
Requerimientos:<br />
<br />
* Conexion a Internet<br />
* FreeBSD instalado<br />
* Leer este manual<br />
<br />
Documentacion:<br />
<br />
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-dhcp.html<br />
<br />
El proceso:<br />
<br />
Actualizar el arbol de ports<br />
<br />
# csup -h cvsup15.us.FreeBSD.org -g -L 2 /usr/share/examples/cvsup/ports-supfile<br />
<br />
Instalar el port ISC-DHCP<br />
<br />
# cd /usr/ports/net/isc-dhcp42-server<br />
<br />
# make config<br />
<br />
(dejamos las opciones como estan por defecto)<br />
<br />
# make install clean<br />
<br />
Hacer que inicie con el sistema y especificando la tarjeta en la que escuchara agregando las lineas corespondientes en /etc/rc.conf<br />
<br />
# echo '# ISC-DHCP Server' >> /etc/rc.conf<br />
# echo 'dhcpd_enable="YES"' >> /etc/rc.conf <br />
# echo 'dhcpd_conf="/usr/local/etc/dhcpd.conf"' >> /etc/rc.conf<br />
# echo 'dhcpd_ifaces="bge1"' >> /etc/rc.conf<br />
<br />
Ajustamos el archivo de configuracion con los parametros que necesitamos, de modo que tenga unas lineas como estas<br />
<br />
# grep -vE '^#|^;|^$' /usr/local/etc/dhcpd.conf<br />
<br />
option domain-name "example.org";<br />
option domain-name-servers 8.8.8.8, 8.8.4.4;<br />
default-lease-time 600;<br />
max-lease-time 7200;<br />
authoritative;<br />
log-facility local7;<br />
subnet 192.168.1.0 netmask 255.255.255.0 {<br />
range 192.168.1.2 192.168.1.10;<br />
option routers 192.168.1.1;<br />
}<br />
<br />
<br />
Iniciamos el servicio<br />
<br />
# /usr/local/etc/rc.d/isc-dhcpd start<br />
<br />
Los comando basicos son<br />
<br />
# /usr/local/etc/rc.d/isc-dhcpd start|stop|restart|statusAngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com0tag:blogger.com,1999:blog-6410840638905218654.post-24750108041250076792012-12-10T10:33:00.001-05:002013-11-08T12:17:32.412-05:00Migracion usuariosIntroduccion:<br />
<br />
Supongamos que tenemos un servidor FreeBSD que comparte contenidos mediante Samba y necesitamos hacer una instalacion nueva, el /home esta en un ZFS RAID-Z lo que nos facilitara la migracion, pero no deseamos crear nuevamente a cada uno de los usuarios en el nuevo FreeBSD (tanto los de FreeBSD como los de Samba).<br />
Este tutorial tambien es valido en caso de un cambio a un nuevo servidor (osea, a otro hadware) en este caso existen comandos adicionales requeridos y <span style="color: red;">se ve claramente con el comando en color rojo</span>, si no esta migrando a un nuevo servidor se deben omitir y continuar con el comando siguiente.<br />
<br />
Requerimientos:<br />
<br />
* <a href="http://angelcontents.blogspot.com/2012/04/freebsd.html" target="_blank">FreeBSD instalado</a><br />
* Leer este manual<br />
<br />
El proceso:<br />
<br />
En el FreeBSD que vamos a quitar <br />
<br />
Hacer un backups de los archivos<br />
<br />
¡Los comandos asumen que se tiene un <a href="http://angelcontents.blogspot.com/2012/11/freebsd-z-file-system-zfs.html" target="_blank">ZFS RAID-Z</a> para el directorio /home, pero puede guardar los datos en otro lugar!<br />
<br />
# mkdir /storage/migracion<br />
# tar -cvzf /storage/migracion/FreeBSD.tar.gz /etc/passwd /etc/master.passwd /etc/group<br />
# tar -cvzf /storage/migracion/Samba.tar.gz /usr/local/etc/samba/passdb.tdb /usr/local/etc/samba/secrets.tdb /usr/local/etc/smb.conf<br />
# tar -cvzf /storage/migracion/mail.tar.gz /var/mail<br />
<span style="color: red;"># tar -cvzf /storage/migracion/home.tar.gz /storage/home</span><span style="color: red;"><b></b></span><br />
# cp -rp /usr/ports/distfiles /storage/migracion <- este es opcional<br />
<br />
<a href="http://www.angelcontents.blogspot.com/2012/04/freebsd.html" target="_blank">En el FreeBSD recien instalado</a> <a href="http://www.angelcontents.blogspot.com/2012/04/freebsd-updating-and-upgrading.html" target="_blank">actualizado</a> y con el arbol de ports al dia <br />
<br />
Instalamos el port de Samba y hacemos que se active al iniciar el sistema<br />
<br />
# cd /usr/ports/net/samba36 && make config-recursive && make install clean<br />
# echo '# Samba' >> /etc/rc.conf<br />
# echo 'samba_enable="YES"' >> /etc/rc.conf<br />
<br />
Ahora nos falta darle soporte a FreeBSD para que pueda usar el arreglo de discos en ZFS RAID-Z, lea la parte del manual que inicia con "<a href="http://www.angelcontents.blogspot.com/2012/11/freebsd-z-file-system-zfs.html" target="_blank">Ahora supongamos que luego de mucho tiempo queremos...</a>" y luego continue en <span style="color: red;">transferir los datos y</span> restaurar el backups.<br />
<br />
<span style="color: red;">Transferir los datos por SSH mediante scp al nuevo servidor</span><br />
<br />
<span style="color: red;"># mkdir /storage/migracion </span><br />
<span style="color: red;"># scp usuario@IPSERVER:/storage/migracion/FreeBSD.tar.gz /storage/migracion</span><br />
<span style="color: red;"># scp usuario@IPSERVER:/storage/migracion/Samba.tar.gz /storage/migracion</span><br />
<span style="color: red;"># scp usuario@IPSERVER:/storage/migracion/mail.tar.gz /storage/migracion</span><br />
<span style="color: red;"># scp usuario@IPSERVER:/storage/migracion/home.tar.gz /storage/migracion</span><br />
<span style="color: red;"># scp -rp usuario@IPSERVER:/storage/migracion/distfiles /storage/migracion <- este es opcional</span><br />
<span style="color: red;"><br /></span>
<span style="color: red;">"usuario" es un usuario existente en el servidor FreeBSD que vamos a quitar</span><br />
<span style="color: red;">"IPSERVER" es la direccion IP del servidor FreeBSD que vamos a quitar</span><br />
<br />
Restaurar el backups<br />
<br />
# cd /<br />
# tar -xvzf /storage/migracion/FreeBSD.tar.gz<br />
# tar -xvzf /storage/migracion/Samba.tar.gz<br />
# tar -xvzf /storage/migracion/mail.tar.gz<br />
# pwd_mkdb -p /etc/master.passwd <br />
<span style="color: red;"># tar -xvzf /storage/migracion/home.tar.gz<b></b></span><br />
# cp -rp /storage/migracion/distfiles /usr/ports <- este es opcional<br />
# rm -rf /storage/migracion<br />
# reboot<br />
<br />
Listo, al entrar nuevamente debemos tener los mismos usuarios y nuestra informacion de la misma forma que la teniamos en el viejo.AngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com0tag:blogger.com,1999:blog-6410840638905218654.post-59677795366809471092012-11-28T17:12:00.001-05:002014-11-14T07:39:45.641-05:00FreeBSD The Z File System (ZFS)<p dir="ltr">Introduccion:</p>
<p dir="ltr">Teniendo FreeBSD ya instalado y funcionando, le vamos a crear una unidad formada por varios discos y usaremos ZFS RAID-Z para guardar los datos de home y los contenidos de los usuarios que vamos creando.</p>
<p dir="ltr"><a href="http://es.wikipedia.org/wiki/ZFS_%28sistema_de_archivos%29">Wikipedia ZFS:</a><br>
ZFS es un sistema de archivos desarrollado por Sun Microsystems para su<br>
sistema operativo Solaris. El significado original era 'Zettabyte File System'<br>
, pero ahora es un acrónimo recursivo.</p>
<p dir="ltr">El anuncio oficial de ZFS se produjo en Septiembre de 2004.1 El código fuente del producto final se integró en la rama principal de desarrollo de Solaris el 31 de octubre de 20052 y fue lanzado el 16 de noviembre de 2005 como parte del build 27 de OpenSolaris.</p>
<p dir="ltr">ZFS fue diseñado e implementado por un equipo de Sun liderado por Jeff Bonwick.</p>
<p dir="ltr">ZFS destaca por su gran capacidad, integración de los conceptos<br>
anteriormente separados de sistema de ficheros y administrador de<br>
volúmenes en un solo producto, nueva estructura sobre el disco, sistemas de<br>
archivos ligeros y una administración de espacios de almacenamiento<br>
sencilla." </p>
<p dir="ltr"><a href="http://es.wikipedia.org/wiki/ZFS_%28sistema_de_archivos%29#Espacios_de_almacenamiento_.28Storage_pools.29">Wikipedia Storage pools:</a><br>
A diferencia de los sistemas de ficheros tradicionales que residen encima de un sólo dispositivo subyacente y por lo tanto requieren un gestor de volúmenes separado si se precisa un sistema de archivos mayor que el dispositivo, ZFS se apoya en espacios de almacenamiento virtuales (virtual storage pools). Los espacios se construyen a partir de uno o más dispositivos virtuales (vdevs), de los que cada uno es o bien un raw device, un mirror (RAID 1) de uno o más dispos todos los vdevs esa disponible para todos los sistemas de archivos del zpool.</p>
<p dir="ltr">Requerimientos:</p>
<p dir="ltr">* <a href="http://angelcontents.blogspot.com/2012/04/freebsd.html">FreeBSD instalado</a><br>
* Leer este manual </p>
<p dir="ltr">Distribucion de los discos:</p>
<p dir="ltr">0    ad10      ada0 }=> FreeBSD:    /, /swap, /var, /tmp, /usr</p>
<p dir="ltr">1    ad12      ada1<br>
2    ad14      ada2<br>
                            }=> ZFS RAID-Z: /storage/home<br>
3    ad16      ada3<br>
4    ad18      ada4</p>
<p dir="ltr">ada0 tendra nuestro FreeBSD y las particiones necesarias como se describe en <a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/bsdinstall-partitioning.html">Example 3-3. Creating Traditional Split Filesystem Partitions</a></p>
<p dir="ltr">ada1, 2, 3 y 4 seran los discos que usaremos para crear nuestro ZFS RAID-Z</p>
<p dir="ltr">El proceso:</p>
<p dir="ltr">Luego de conectar los discos para el RAID-Z y encender nuestro FreeBSD, miramos como estan los discos:</p>
<p dir="ltr"># cat /var/run/dmesg.boot | grep ada</p>
<p dir="ltr">En la salida nos muestra que efectivamente tenemos ada1, ada2, ada3 y ada4.</p>
<p dir="ltr">Segun el handbook:<br>
<a href="http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/filesystems-zfs.html">http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/filesystems-zfs.html</a></p>
<p dir="ltr">Hacemos que se carguen los modulos al iniciar FreeBSD:</p>
<p dir="ltr"># echo '# The Z File System (ZFS)' >> /boot/loader.conf<br>
# echo 'vm.kmem_size="512M"' >> /boot/loader.conf<br>
# echo 'vm.kmem_size_max="512M"' >> /boot/loader.conf<br>
# echo 'vfs.zfs.arc_max="40M"' >> /boot/loader.conf<br>
# echo 'vfs.zfs.vdev.cache.size="5M"' >> /boot/loader.conf</p>
<p dir="ltr">Si tengo menos de 4GB de RAM se pone tambien esta otra linea:</p>
<p dir="ltr"># echo 'vfs.zfs.prefetch_disable="0"' >> /boot/loader.conf</p>
<p dir="ltr">Nota<br>
Las lineas de arriba son diferentes a las que estan en el handbook ya que unos mensajes al cargar FreeBSD recomiendan dichos valores.</p>
<p dir="ltr">Hacemos que se active ZFS al iniciar FreeBSD:</p>
<p dir="ltr"># echo '# Using ZFS' >> /etc/rc.conf<br>
# echo 'zfs_enable="YES"' >> /etc/rc.conf</p>
<p dir="ltr">Iniciamos ZFS <br>
# /etc/rc.d/zfs start</p>
<p dir="ltr">Creamos el pool con los discos y lo llamaremos "storage":</p>
<p dir="ltr"># zpool create storage raidz ada1 ada2 ada3 ada4</p>
<p dir="ltr">si da un error, usar la opcion -f, algo asi "zpool create -f storage ..."</p>
<p dir="ltr">Creamos el ZFS y lo llamaremos "home"</p>
<p dir="ltr"># zfs create storage/home</p>
<p dir="ltr">Copiamos el contenido de home, borramos las viejas rutas y creamos las nuevas:</p>
<p dir="ltr"># cp -rp /home/* /storage/home<br>
# rm -rf /home /usr/home<br>
# ln -s /storage/home /home<br>
# ln -s /storage/home /usr/home</p>
<p dir="ltr">Reiniciamos FreeBSD:</p>
<p dir="ltr"># reboot</p>
<p dir="ltr">Al entrar nuevamente a FreeBSD, miramos como esta la cosa:</p>
<p dir="ltr"># df -h<br>
Filesystem      Size    Used   Avail Capacity  Mounted on<br>
...<br>
storage         2.7T     45k    2.7T     0%    /storage<br>
storage/home    2.7T     54k    2.7T     0%    /storage/home <- Nuestro ZFS RAID-Z :-)</p>
<p dir="ltr"># mount<br>
... <br>
storage on /storage (zfs, local, nfsv4acls)<br>
storage/home on /storage/home (zfs, local, nfsv4acls)</p>
<p dir="ltr">Activamos el reporte diario del estado del ZFS:</p>
<p dir="ltr"># echo '# The ZFS' >> /etc/periodic.conf<br>
# echo 'daily_status_zfs_enable="YES"' >> /etc/periodic.conf </p>
<p dir="ltr">Ver estado del raid:</p>
<p dir="ltr"># zpool status<br>
  pool: storage<br>
 state: ONLINE<br>
 scan: none requested<br>
config:</p>
<p dir="ltr">    NAME        STATE     READ WRITE CKSUM<br>
    storage     ONLINE       0     0     0<br>
      raidz1-0  ONLINE       0     0     0<br>
        ada1    ONLINE       0     0     0<br>
        ada2    ONLINE       0     0     0<br>
        ada3    ONLINE       0     0     0<br>
        ada4    ONLINE       0     0     0</p>
<p dir="ltr">errors: No known data errors</p>
<p dir="ltr"># zpool status -x<br>
all pools are healthy</p>
<p dir="ltr">Ejemplo de como recuperar nuestro RAID si uno de los discos se daña (se copia del handbook y se ajustan los nombres "ad" por "ada"):</p>
<p dir="ltr">21.2.2.3 Recovering RAID-Z</p>
<p dir="ltr">pool: storage<br>
 state: DEGRADED<br>
status: One or more devices has been taken offline by the administrator.<br>
    Sufficient replicas exist for the pool to continue functioning in a<br>
    degraded state.<br>
action: Online the device using 'zpool online' or replace the device with<br>
    'zpool replace'.<br>
 scrub: none requested<br>
config:</p>
<p dir="ltr">    NAME        STATE     READ WRITE CKSUM<br>
    storage     DEGRADED     0     0     0<br>
      raidz1-0  DEGRADED     0     0     0<br>
      ada1      OFFLINE      0     0     0  <- El disco ada1 malo<br>
      ada2      ONLINE       0     0     0<br>
      ada3      ONLINE       0     0     0<br>
      ada4      ONLINE       0     0     0</p>
<p dir="ltr">errors: No known data errors</p>
<p dir="ltr">Sacamos ada1 del arreglo:</p>
<p dir="ltr"># zpool offline storage ada1</p>
<p dir="ltr">Apagamos el equipo:</p>
<p dir="ltr"># shutdown -h now</p>
<p dir="ltr">Cambiamos el disco ada1 malo por uno bueno y encendemos el equipo</p>
<p dir="ltr">Agregamos el disco ada1 al arreglo:</p>
<p dir="ltr"># zpool replace storage ada1</p>
<p dir="ltr">Verificamos:</p>
<p dir="ltr"># zpool status storage<br>
 pool: storage<br>
 state: ONLINE<br>
 scrub: resilver completed with 0 errors on Sat Aug 30 19:44:11 2008<br>
config:</p>
<p dir="ltr">    NAME        STATE     READ WRITE CKSUM<br>
    storage     ONLINE       0     0     0<br>
      raidz1-0  ONLINE       0     0     0<br>
      ada1      ONLINE       0     0     0<br>
      ada2      ONLINE       0     0     0<br>
      ada3      ONLINE       0     0     0<br>
      ada4      ONLINE       0     0     0</p>
<p dir="ltr">errors: No known data errors</p>
<p dir="ltr"># zpool status -x<br>
all pools are healthy</p>
<p dir="ltr">Si queremos eliminar el POOL y el ZFS que tenemos hasta el momento:</p>
<p dir="ltr">Cuidado, los dos comandos siguientes eliminan el arreglo y los datos!</p>
<p dir="ltr">Eliminar el ZFS:</p>
<p dir="ltr"># zfs destroy storage/home</p>
<p dir="ltr">Eliminar el pool:</p>
<p dir="ltr"># zpool destroy storage</p>
<p dir="ltr">Bueno, ya tenemos nuestro arreglo de discos en ZFS RAID-Z, pero una de las cosas interesantes de todo esto son las quotas de disco para los usuarios que se conectaran desde la red por Samba...</p>
<p dir="ltr">21.2.2.5 ZFS Quotas</p>
<p dir="ltr">Crear el ZFS para jdoe:</p>
<p dir="ltr"># zfs create storage/home/jdoe</p>
<p dir="ltr">Crearle una quota de 10G a jdoe:</p>
<p dir="ltr"># zfs set quota=10G storage/home/jdoe</p>
<p dir="ltr">Reporte de la quota:</p>
<p dir="ltr"># zfs get quota storage/home/jdoe<br>
NAME               PROPERTY  VALUE  SOURCE<br>
storage/home/jdoe  quota     10G     local</p>
<p dir="ltr">Ejemplo de como quitarle la quota a jdoe:</p>
<p dir="ltr"># zfs set quota=none storage/home/jdoe</p>
<p dir="ltr">Reporte de la quota (para ver si se la quito):</p>
<p dir="ltr"># zfs get quota storage/home/jdoe<br>
NAME               PROPERTY  VALUE  SOURCE<br>
storage/home/jdoe  quota     none   local</p>
<p dir="ltr">Ahora ya podemos crear el usuario "jdoe":</p>
<p dir="ltr"># adduser<br>
Username: jdoe<br>
Full name: John Doe<br>
...</p>
<p dir="ltr">Por defecto al agregar el usuario se crea la carpeta /home/jdoe y esta gracias al link que ya tenemos se creara en storage/home/jdoe</p>
<p dir="ltr">Ahora supongamos que luego de mucho tiempo queremos hacer una instalacion completamente nueva de FreeBSD en ada0 y logicamente queremos continuar usando nuestro ZFS RAID-Z y los datos que en ese lugar tenemos...</p>
<p dir="ltr">En el FreeBSD recien instalado</p>
<p dir="ltr">Cargar las opciones en el loader.conf:</p>
<p dir="ltr"># echo '# The Z File System (ZFS)' >> /boot/loader.conf<br>
# echo 'vm.kmem_size="512M"' >> /boot/loader.conf<br>
# echo 'vm.kmem_size_max="512M"' >> /boot/loader.conf<br>
# echo 'vfs.zfs.arc_max="40M"' >> /boot/loader.conf<br>
# echo 'vfs.zfs.vdev.cache.size="5M"' >> /boot/loader.conf</p>
<p dir="ltr">Si tengo menos de 4GB de RAM se pone esta otra linea:</p>
<p dir="ltr"># echo 'vfs.zfs.prefetch_disable="0"' >> /boot/loader.conf</p>
<p dir="ltr">Cargar las opciones en el rc.conf:</p>
<p dir="ltr"># echo '# Using ZFS' >> /etc/rc.conf<br>
# echo 'zfs_enable="YES"' >> /etc/rc.conf<br>
# /etc/rc.d/zfs start</p>
<p dir="ltr">Importar el pool:</p>
<p dir="ltr"># zpool import storage</p>
<p dir="ltr">Activamos el reporte diario del estado del ZFS:</p>
<p dir="ltr"># echo '# The ZFS' >> /etc/periodic.conf <br>
# echo 'daily_status_zfs_enable="YES"' >> /etc/periodic.conf</p>
<p dir="ltr">Eliminar las rutas viejas y crear las nuevas para el storage:</p>
<p dir="ltr"># rm -rf /home /usr/home<br>
# ln -s /storage/home /home<br>
# ln -s /storage/home /usr/home</p>
<p dir="ltr">Listo, si reiniciamos el FreeBSD, debemos poder ver todo bien.</p>
<p dir="ltr">Este manual se hizo con FreeBSD 9.0 RELEASE. </p>
<p dir="ltr">Actualizacion 2014/10/09</p>
<p dir="ltr">Recientemente instale FreeBSD 10.0 con la nueva opcion ZFS (experimental) para usar ese sistema de archivos tambien para FreeBSD.</p>
<p dir="ltr">Ya no se agrega nada relacionado con el soporte a ZFS en /etc/rc.conf, tampoco hay que agregar parametros en /boot/loader.conf pues en el nuevo instalador de FreeBSD 10.0 ya deja todo listo.</p>
<p dir="ltr">Hay que eliminar el volumen zroot/usr/home para poder montar /storage/home</p>
<p dir="ltr"># umount /usr/home<br>
# zfs destroy zroot/usr/home<br>
# rm /home<br>
# zpool import storage<br>
# ln -s /storage/home /home<br>
# ln -s /storage/home /usr/home</p>
AngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com0tag:blogger.com,1999:blog-6410840638905218654.post-77309709496415655962012-10-18T14:43:00.001-05:002015-04-08T16:57:17.193-05:00Android y como pagar menos en llamadas internacionalesEs muy comun que tengamos amigos o familiares fuera del pais y necesitemos llamarlos en algun momento...<br />
<br />
Por fortuna tenemos a las <strike>abusivas</strike> operadoras de larga distancia, que con sus <strike>caras</strike> tarifas internacionales nos quieren <strike>quitar hasta el ultimo billete</strike> ayudar para que estemos siempre en contacto.<br />
<br />
Yo les quiero contar un secreto muy interesante, <b>¡Se puede llamar por muchisimo menos!</b> Ahorrandonos un dinero que podemos usar en otras cosas, como comprarnos un magnifico telefono con Android como el <a href="http://es.wikipedia.org/wiki/Galaxy_nexus" target="_blank">Samsung Galaxy Nexus GT-I9250 GSM/HSPA+</a>, <a href="http://www.amazon.com/s/ref=nb_sb_noss_1?url=search-alias%3Daps&field-keywords=galaxy+nexus+gsm" target="_blank">comprarlo en Amazon.com libre por un buen precio</a> o hasta en el operador Tigo de Colombia en reposicion con permanencia de 2 años por unos $500.000 pesos en el plan "Arma tu Plan 70" o totalmente libre, miren <a href="http://tigo.com.co/node/2470" target="_blank">aqui</a>.<br />
<br />
Bueno, retomando lo de las llamadas mas baratas...<br />
<br />
Para llamar a otros paises se puede usar una cuenta SIP, es algo similar a un messenger pero que en lugar de enviar mensajes de texto se habla pagando algo de dinero, se puede crear una cuenta SIP en alguna de las empresas que prestan ese servicio, yo uso una muy economica llamada <a href="https://www.diamondcard.us/" target="_blank">DiamondCard</a>, tiene buenos <a href="https://www.diamondcard.us/exec/voip-rep-acc-type?priInc=/corporate?sr%3D/secondary/corporate%26pr%3D/templates%26ht%3D/templates&secInc=/corporate?sr%3D/secondary/corporate%26pr%3D/templates%26ht%3D/secondary/corporate&secAbs=/home/diamond/secondary/corporate&secRel=/secondary/corporate&priAbs=/home/diamond/templates&priRel=/templates&secId=corporate&lc=" target="_blank">precios</a>, basicamente es un sistema prepago, se compra un saldo por unos 20 dolares, que se pagan con una tarjeta de credito, es muy facil, se crea una cuenta con usuario y clave y luego compramos algo de saldo. Al terminar de crear nuestra cuenta SIP nos dan unos datos similares a estos:<br />
<br />
(1) Login y Password para entrar en la web por <a href="https://www.diamondcard.us/login">https://www.diamondcard.us/login</a> en donde podemos ver nuestro registro de llamadas y cargar mas saldo.<br />
<br />
Login: john<br />
<div>
Password: clavesecretadejohn</div>
<div>
<br /></div>
<div>
(2) El "Account ID" y "PIN code" para configurar la cuenta SIP en nuestro
Android o la aplicacion que usemos.</div>
<div>
<br />
Account ID: 471234</div>
<div>
PIN code: 123456789012<br />
Server: sip.diamondcard.us<br />
<br />
(los datos de arriba son ficticios para ejemplo)<br />
<br />
Nota:<br />
La informacion de "Account ID" y "PIN code" siempre la
podremos ver en la web luego de loguearnos (en la parte superior derecha
donde esta tambien nuestro saldo).<br />
<br />
Al tener ya nuestra cuenta SIP con saldo, ya podemos empezar a usarla, para eso tenemos dos opciones, el tradicional computador (aburrido y ya poco practico) o con nuestro magnifico Galaxy Nexus con Android (esta es mi preferida), que nos permite estar en cualquier lugar y ya sea con WiFi o con algun plan de datos 3G, hacer llamadas por menos de 50 pesos el minuto (ver <a href="https://www.diamondcard.us/exec/voip-rep-acc-type?priInc=/corporate?sr%3D/secondary/corporate%26pr%3D/templates%26ht%3D/templates&secInc=/corporate?sr%3D/secondary/corporate%26pr%3D/templates%26ht%3D/secondary/corporate&secAbs=/home/diamond/secondary/corporate&secRel=/secondary/corporate&priAbs=/home/diamond/templates&priRel=/templates&secId=corporate&lc=" target="_blank">precios</a>).<br />
<br />
Si aun no tenemos un telefono "NEXUS", podemos ir a comprarlo, mientras lo compramos, podemos usar nuestro coputador y descargar he instalar el programa de DiamondCard que se baja de aqui para <a href="http://www.diamondcard.us/download/SoftPhoneSetup219b.exe" target="_blank">Windows</a>, o si ya cansados de los problemas con Window tenemos un MacBook, le descargamos algun cliente como <a href="http://www.linphone.org/eng/download/packages/linphone.html" target="_blank">LinPhone</a>. <br />
<br />
Si somos los felices poseedores de un telefono con Android como el Galaxy ACE igualmente le tenemos que instalar LinPhone que esta en la tienda de Google Play Store gratis y en el programita ingresar los datos suministrados por DiamodCard de nuestra cuenta SIP, ya que dicho telefono viene con Android 2.3 y este aun no tiene cliente nativo para cuentas SIP.<br />
<br />
Si tenemos el magnifico Galaxy Nexus, con Android 4.0.4 o superior, no tendremos que bajar nada, pues Android 4.0.4 ya tiene cliente nativo para cuentas SIP, para configurarlo y como es el telefono que tengo, les dare las instrucciones paso a paso...<br />
<br />
Configurar tu cuenta SIP en el Samsung Galaxy Nexus:<br />
<br />
1 Abrimos el marcador como si fueramos a escribir algun numero para llamar<br />
2 Nos vamos a Settings (seleccionando los tres punticos)<br />
3 Bajamos hasta donde dice "INTERNET CALL SETTINGS" Accounts<br />
4 Seleccionamos "ADD ACCOUNT"<br />
5 Ingresamos los datos requeridos:<br />
<br />
Username<br />
471234 <- escribir el "Account ID"<br />
Password<br />
123456789012 <- escribir el "PIN code"<br />
Server<br />
sip.diamondcard.us<br />
<br />
6 Seleccionamos "SAVE"<br />
<br />
Listo, ya debemos ver nuestra cuenta creada, se ve algo asi:<br />
<br />
471234@sip.diamondcard.us<br />
<br />
Ahora debemos decirle a nuestro telefono que nos pregunte en cada llamada si queremos llamar usando al operador celular o llamar por Internet usando nuestra cuenta SIP y el saldo que compramos en DiamondCard.us, para hacer esto nos vamos de forma similar que en las instrucciones anteriores:<br />
<br />
1 Abrimos el marcador como si fueramos a escribir algun numero para llamar<br />
2 Nos vamos a Settings (seleccionando los tres punticos)<br />
3 Bajamos hasta donde dice "Use Interned calling" y activamos "Ask for each call.<br />
<br />
Ahora vamos a llamar a nuestro primer contacto llamado "Pepe Cortisona" que vive en USA y que cariñosamente apodamos "saco de plomo", para hacerlo, debemos tener o crear un contacto y colocarle el telefono de USA, ya sea celular o fijo, por ejemplo:<br />
<br />
(codpais codciudad telefono)<br />
<br />
1 646 362 1234<br />
<br />
Guardamos los datos de "saco de plomo" y ya lo podemos llamar para hacer nuestra prueba, al seleccionar nuestro contacto, nos sale una ventanita<br />
<br />
Place call<br />
Cell phone call<br />
Internet call<br />
<br />
Tocamos "Internet call" y en unos segundo timbrara la llamada y nos podra contestar nuestro amigo en USA.<br />
<br />
2014/11/20 Actualizacion:</div>
<div>
<br />
Configurar tu cuenta SIP en el LG Nexus 5:<br />
<br />
1 Abrimos el marcador como si fueramos a llamar<br />
2 Nos vamos a Settings (seleccionando los tres punticos)<br />
3 Calls<br />
4 Calling accounts<br />
5 SIP accounts <br />
6 "ADD ACCOUNT"<br />
7 Ingresamos los datos requeridos:<br />
<br />
Username<br />
471234 <- escribir el "Account ID"<br />
Password<br />
123456789012 <- escribir el "PIN code"<br />
Server<br />
sip.diamondcard.us<br />
<br />
8 Seleccionamos "SAVE"<br />
<br />
Ahora debemos decirle a nuestro telefono que nos pregunte en cada
llamada si queremos llamar usando al operador celular o llamar por
Internet usando nuestra cuenta SIP y el saldo que compramos en
DiamondCard.us, para hacer esto nos vamos de forma similar que en las
instrucciones anteriores:<br />
<br />
1 Abrimos el marcador como si fueramos a llamar<br />
2 Nos vamos a Settings (seleccionando los tres punticos)<br />
3 Calls<br />
4 Calling accounts<br />
5 Make calls with <br />
TIGO -> Ask first<br />
6 Use SIP calling<br />
Only for SIP calls -> For all calls<br />
<br />
Listo, ahora al llamar nos preguntara si usa TIGO o SIP <br />
<br /></div>
AngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com0tag:blogger.com,1999:blog-6410840638905218654.post-46381913292847398482012-09-26T13:20:00.001-05:002014-05-07T10:38:11.771-05:00Samsung Galaxy Nexus GT-I9250 Google Factory ImagesEl Samsung Galaxy Nexus es un telefono muy bueno que se vende en todo el mundo, existen tres modelos:<br />
<ul>
<li><a href="http://www.gsmarena.com/samsung_galaxy_nexus_i9250-4219.php" target="_blank">Samsung Galaxy Nexus GT-I9250 GSM/HSPA+</a> "maguro" de 16GB, dependiendo de donde se compre puede venir con el firmware llamado "takju" (con Google Wallet para USA) o con "yakju" (sin Google Wallet para todos los demas paises).</li>
<li><a href="http://www.gsmarena.com/samsung_galaxy_nexus_i515-4301.php" target="_blank">Galaxy Nexus SCH-i515 CDMA/LTE</a> "toro" de 32GB, es el modelo que vende <a href="http://www.verizonwireless.com/" target="_blank">Verizon Wireless</a>.</li>
<li><a href="http://www.gsmarena.com/samsung_galaxy_nexus_lte_l700-4406.php" target="_blank">Galaxy Nexus LTE 700 CDMA/LTE</a> "toroplus" de 32GB, es el modelo que vende <a href="http://www.sprint.com/" target="_blank">Sprint</a>. </li>
</ul>
<ol>
</ol>
Este tutorial enseña como flashear nuestro equipo para la version GT-I9250 GSM/HSPA+, pero tambien debe funcionar si estas en Estados Unidos y tienes el de Verizon o Sprint, solo hay que poner cuidado de descargar la imagen correcta para nuestro modelo de hardware ("maguro", "toro" o "toroplus").<br />
<br />
Los telefonos "NEXUS" son los que Google manda a hacer con alguno de los fabricantes, Samsung en el caso del Galaxy Nexus, por eso Google es quien nos proporciona las actualizaciones directamente si lo compramos en la tienda Google Play Store o en alguna otra tienda libre.<br />
<br />
Si compramos nuestro "NEXUS" con algun operador, viene con un firmware de Android "ajustado" por Samsung y hasta puede venir con algunas aplicaciones del operador, en este caso las actualizaciones se demoran mas, mientras Samsung ajusta la nueva version de Android y las aplicaciones solicitadas del operador. Esto logicamente genera demoras!<br />
<br />
Si tenemos un "NEXUS" y Google nos da las imagenes de fabrica, podemos flashear nuestro equipo con el Android y ya seguir recibiendo las actualizaciones directamente via "OTA" (Over-The-Air) sin tener que esperar a Samsung y/o al operador.<br />
<br />
Las imagenes se pueden ver aqui <a href="https://developers.google.com/android/nexus/images">https://developers.google.com/android/nexus/images</a><br />
<br />
Contar con la ultima version de Android nos puede brindar muchas cosas buenas, correccion de errores, nuevas funcionalidades y optimizaciones. Lo ideal es poder disfrutar de esos beneficios durante el tiempo de vida del telefono mientras Google le saque actualizaciones (el modelo anterior llamado Nexus S tiene casi 3 años y aun le sacan actualizaciones).<br />
<br />
Otro tema y que por fortuna no afecta a los "NEXUS", es una capa que los fabricantes le ponen a Android para que se vea diferente, dicha capa puede hacer aun mas demorada la actualizacion de Android, algunos ejemplos son el "TouchWiz" de Samsung, el "Motoblur" de Motorola, el "Sense" de HTC. Todo eso es mas trabajo de programacion, es costoso, quita tiempo y que con las ultimas versiones de Andriod ya no son necesarias.<br />
<br />
En el caso del Galaxy Nexus GT-I9250 GSM/HSPA+, todos los equipos son iguales en hardware denominado "maguro", y que vienen con alguna variante de Android "yakju" para los que se venden en Europa o "takju" para los que se venden en Estados Unidos y que vienen con el Google Wallet.<br />
<br />
Para saber si nuestro equipo recibe las actualizaciones directamente de Google o de Samsung, podemos mirar los datos de "Baseband version" vemos que puede tener algo como esto:<br />
<br />
I9250XXLA2 <- version de Samsung para Latino America<br />
<br />
I9250XXLF1 <- version de Google para Estados Unidos<br />
<br />
Para ver estos datos, vamos a Settings -> About phone<br />
<br />
Al instalarle a nuestro telefono la imagen de fabrica, es como si se lo compraramos directamente a Google en lugar de a el operador! Por eso al eliminar la dependencia Samsung y operador, las actualizacines nos llegaran mas rapido, para hacer esto, debemos flashear el equipo...<br />
<br />
Flashear un equipo es algo delicado, se debe hacer con cuidado y bien o nos podemos quedar con un ladrillito en lugar de un telefono!<br />
<br />
Si se hace bien no debemos tener problemas, pero todo tiene un minimo de riesgo y puede que la garantia no lo cubra si lo dañamos haciendo mal el proceso, las instrucciones de abajo son de como yo lo hice, pero no puedo garantizar que les funcione o que el telefono no tenga que pasar por el centro de servicio si usted lo hace mal, es bajo su responsabilidad.<br />
<br />
Para realizar el flasheo, se necesita de un computador Mac, tambien se puede hacer desde un computador con Windows, pero yo no tengo este ultimo (no me gusta Windows) y en Windows se requiere la descarga de otras cosas...<br />
<br />
El proceso de flasheo elimina toda informacion del equipo como son fotos y musica, los contactos se almacenan en la cuenta de Google con lo que al iniciar nuevamente luego del flasheo se sincronizaran automaticamente. Por esto debemos hacer backup de nuestas fotos y musica!<br />
<br />
Las imagenes para la version GSM/HSPA+ son:<br />
Factory Images "yakju" for Galaxy Nexus "maguro" (GSM/HSPA+)<br />
<a href="https://developers.google.com/android/nexus/images#yakju">https://developers.google.com/android/nexus/images#yakju</a> <br />
Factory Images "takju" for Galaxy Nexus "maguro" (GSM/HSPA+) (with Google Wallet)<br />
<a href="https://developers.google.com/android/nexus/images#takju">https://developers.google.com/android/nexus/images#takju</a><br />
<br />
Se pueden usar "yakju" o "takju" indistintamente siempre que nuestro equipo sea "maguro", osea la version GT-I9250 GSM/HSPA+ ;-) <br />
<br />
Actualizacion manual a 4.1.1 (JRO03C) <- Jelly Bean para "yakju":
<br />
<div>
<br clear="none" /></div>
1 Descargar Factory Image <a href="https://dl.google.com/dl/android/aosp/yakju-jro03c-factory-3174c1e5.tgz">https://dl.google.com/dl/android/aosp/yakju-jro03c-factory-3174c1e5.tgz</a><br />
2 Descomprimir el archivo .tgz en el home de nuestro usuario de Mac OS X<br />
3 Descargar el <a href="http://wiki.cyanogenmod.org/w/Doc:_fastboot_intro" target="_blank">fastboot</a> de aqui ADT Bundle <a href="http://dl.google.com/android/adt/22.6.2/adt-bundle-mac-x86_64-20140321.zip">http://dl.google.com/android/adt/22.6.2/adt-bundle-mac-x86_64-20140321.zip</a> tambien de aqui <a href="https://drive.google.com/folderview?id=0B-ODrM4HjfLrQTNEb2NPd1ZYYUk&usp=sharing" target="_blank">Google Drive</a><br />
4 Descomprimir el archivo .zip y meterlo dentro de la carpeta yakju-jro03c creada en el paso 2<br />
5 Apagar el telefono<br />
6 Encenderlo en "FASTBOOT MODE" presionar volumen arriba + volumen abajo + power<br />
<br />
FASTBOOT MODE<br />
LOCK STATE - UNLOCKED <- si vemos esto podemos continuar, en caso contrario, mirar las notas al final<br />
<br />
7 Abrimos el terminal<br />
8 Darle permisos de ejecucion al archivo fastboot<br />
$ chmod +x ~/yakju-jro03c/fastboot<br />
9 Darle permisos de ejecucion al archivo flash-all.sh<br />
$ chmod +x ~/yakju-jro03c/flash-all.sh<br />
10 Con el editor del computador editamos el archivo llamado flash-all.sh para ajustar los path (rutas) y guardar los cambios, la parte de las rutas se ven asi:<br />
...<br />
~/yakju-jro03c/fastboot flash bootloader bootloader-maguro-primelc03.img<br />
~/yakju-jro03c/fastboot reboot-bootloader<br />
sleep 5<br />
~/yakju-jro03c/fastboot flash radio radio-maguro-i9250xxlf1.img<br />
~/yakju-jro03c/fastboot reboot-bootloader<br />
sleep 5<br />
~/yakju-jro03c/fastboot -w update image-yakju-jro03c.zip <br />
<br />
11 Entrar al directorio donde tenemos el archivo fastboot junto con los archivos de la imagen<br />
$ cd ~/yakju-jro03c<br />
12 Correr el script<br />
$ ~/yakju-jro03c/flash-all.sh<br />
...<br />
sending 'bootloader' (2308 KB)... OKAY<br />
writing 'bootloader'... OKAY<br />
rebooting into bootloader... OKAY<br />
sending 'radio' (12288 KB)... OKAY<br />
writing 'radio'... OKAY<br />
rebooting into bootloader... OKAY<br />
archive does not contain 'boot.sig'<br />
archive does not contain 'recovery.sig'<br />
archive does not contain 'system.sig'<br />
--------------------------------------------<br />
Bootloader Version...: PRIMELC03<br />
Baseband Version.....: I9250XXLF1<br />
Serial Number........: 015y73651A122021 <- he cambiado esto para no publicar mi IMEI <br />
--------------------------------------------<br />
checking product... OKAY<br />
checking version-bootloader... OKAY<br />
checking version-baseband... OKAY<br />
sending 'boot' (4366 KB)... OKAY<br />
writing 'boot'... OKAY<br />
sending 'recovery' (4708 KB)... OKAY<br />
writing 'recovery'... OKAY<br />
sending 'system' (396675 KB)... OKAY<br />
writing 'system'... OKAY<br />
erasing 'userdata'... OKAY<br />
erasing 'cache'... OKAY<br />
rebooting...
<br />
<div>
<br clear="none" />
Nuestro telefono se re-inicia solito y ya lo podemos usar metiendo los datos de nuestra cuenta y clave de Google.<br />
<br clear="none" />
Si todo lo hicimos correctamente, al mirar nuestro telefono, nos debe mostar algo como esto ;-)<br />
<br clear="none" />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-9uk5VVpCJRQ/UGNS3ft4n9I/AAAAAAAACLc/UJ_MVht2PeQ/s1600/Google-Screenshot_2012-08-03-22-22-16.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/-9uk5VVpCJRQ/UGNS3ft4n9I/AAAAAAAACLc/UJ_MVht2PeQ/s320/Google-Screenshot_2012-08-03-22-22-16.png" height="320" width="180" /></a></div>
<br clear="none" />
Es posible que luego cada que encendemos el equipo, nos muestre un cadadito abierto, para que el telefono no quede con el candadito abierto luego de hacer la
actualizacion, seguimos los pasos 5, 6 y ejecutamos el comando de las
notas y lo re-iniciamos.</div>
-------------------------------------------------------------<br />
Notas:<br />
LOCK STATE - LOCKED para cambiarlo<br />
$ ~/yakju-jro03c/fastboot oem unlock<br />
volumen arriba + power para cambiarlo
<br />
<div>
<br clear="none" /></div>
LOCK STATE - UNLOCKED para cambiarlo<br />
$ ~/yakju-jro03c/fastboot oem lock<br />
-------------------------------------------------------------<br />
<br />
Actualizacion:<br />
Hoy (10/10/2012) salio la version 4.1.2 (JZO54K) <- Jelly Bean, siguiendo el manual y ajustando los nombres para la nueva version, he usado la imagen "Factory Images "takju" for Galaxy Nexus "maguro" (GSM/HSPA+) (with Google Wallet)" <a href="https://dl.google.com/dl/android/aosp/takju-jzo54k-factory-92830c0b.tgz">https://dl.google.com/dl/android/aosp/takju-jzo54k-factory-92830c0b.tgz</a> sin ningun problema para actualizar mi telefono.<br />
<br />
Al correr el script en el paso 12, nos muestra unos errores, pero no es importante, vemos algo como esto:<br />
...<br />
ERROR: could not get pipe properties<br />
sending 'bootloader' (2308 KB)... OKAY<br />
writing 'bootloader'... OKAY<br />
ERROR: could not get pipe properties<br />
rebooting into bootloader... OKAY<br />
ERROR: could not get pipe properties<br />
sending 'radio' (12288 KB)... OKAY<br />
writing 'radio'... OKAY<br />
ERROR: could not get pipe properties<br />
rebooting into bootloader... OKAY<br />
archive does not contain 'boot.sig'<br />
archive does not contain 'recovery.sig'<br />
archive does not contain 'system.sig'<br />
ERROR: could not get pipe properties<br />
--------------------------------------------<br />
Bootloader Version...: PRIMELC03<br />
Baseband Version.....: I9250XXLF1<br />
Serial Number........: 015y73651A122021<br />
--------------------------------------------<br />
checking product... OKAY<br />
checking version-bootloader... OKAY<br />
checking version-baseband... OKAY<br />
sending 'boot' (4368 KB)... OKAY<br />
writing 'boot'... OKAY<br />
sending 'recovery' (4710 KB)... OKAY<br />
writing 'recovery'... OKAY<br />
sending 'system' (407055 KB)... OKAY<br />
writing 'system'... OKAY<br />
erasing 'userdata'... OKAY<br />
erasing 'cache'... OKAY<br />
rebooting... <br />
<br />
al mirar nuestro telefono, nos debe mostar algo como esto ;-)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-_BE1OMlJs5o/UHYVpCKIu6I/AAAAAAAACUY/sL4b2izKtXI/s1600/Google-Screenshot_2012-10-10-17-09-58.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-_BE1OMlJs5o/UHYVpCKIu6I/AAAAAAAACUY/sL4b2izKtXI/s320/Google-Screenshot_2012-10-10-17-09-58.png" height="320" width="180" /></a></div>
AngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com13tag:blogger.com,1999:blog-6410840638905218654.post-91526264384648242272012-05-25T13:50:00.000-05:002015-01-26T08:46:07.183-05:00ICINGAIntroduccion:<br />
<br />
Instalar ICINGA en FreeBSD<br />
<br />
Requerimientos:<br />
<br />
* Conexion a Internet<br />
* FreeBSD instalado<br />
* Apache22 instalado<br />
* Leer este manual<br />
<br />
Documentacion de Icinga:<br />
<br />
<a href="http://docs.icinga.org/latest/en/index.html" target="_blank">http://docs.icinga.org/latest/en/index.html </a><br />
<br />
El proceso:<br />
<br />
Actualizar el arbol de ports<br />
# csup -h cvsup16.us.FreeBSD.org -g -L 2 /usr/share/examples/cvsup/ports-supfile<br />
<br />
Instalar el port icinga<br />
<br />
# cd /usr/ports/net-mgmt/icinga<br />
<br />
# make config<br />
<br />
Options for icinga 1.7.0_2<br />
<br />
[X] EMBEDDED_PERL Enable embedded Perl<br />
[X] IDOUTILS Enable IDOUtils<br />
<br />
<OK><br />
<br />
# make install clean<br />
<br />
Options for libdbi-drivers 0.8.3.1_5<br />
<br />
[X] MYSQL With MySQL Driver<br />
[X] PGSQL With PostgreSQL Driver<br />
[ ] SQLITE3 With SQLite 3 Driver <- Desactivo esta, no quiero sqlite<br />
<br />
pw: unknown group `icinga'<br />
You need a "icinga" group.<br />
Would you like me to create it [YES]? YES<br />
<br />
Done.<br />
pw: no such user `icinga'<br />
You need a "icinga" user.<br />
Would you like me to create it [YES]? YES<br />
<br />
Hacer que inicie con el sistema editando /etc/rc.conf<br />
<br />
# edit /etc/rc.conf<br />
<br />
Agregar la linea<br />
<br />
icinga_enable="YES"<br />
<br />
Instalar el port nagios-plugins<br />
<br />
# cd /usr/ports/net-mgmt/nagios-plugins<br />
<br />
# make install clean<br />
<br />
Instalar los logos para Icinga<br />
<br />
# cd /usr/local/www/icinga/images/logos<br />
# fetch https://www.monitoringexchange.org/attachment/download/Artwork/Image-Packs/Base-Images/imagepak-base.tar.tar <br />
# tar -xvzf imagepak-base.tar.tar<br />
# mv base/* /usr/local/www/icinga/images/logos/<br />
# rm -rf base<br />
# rm imagepak-base.tar.tar<br />
# fetch https://www.monitoringexchange.org/attachment/download/Artwork/Image-Packs/Network-Symbols/symbols-v1.1.tar.gz<br />
# tar -xvzf symbols-v1.1.tar.gz<br />
# mv symbols/* /usr/local/www/icinga/images/logos/<br />
# rm symbols-v1.1.tar.gz <br />
# rm -rf symbols<br />
<br />
Otros logos se pueden descargar de aqui (opcional)<br />
<a href="https://www.monitoringexchange.org/inventory/Artwork/Image-Packs">https://www.monitoringexchange.org/inventory/Artwork/Image-Packs</a><br />
<br />
Crear el archivo htpasswd.users<br />
<br />
# touch /usr/local/etc/icinga/htpasswd.users<br />
<br />
Agregar los usuarios y las claves<br />
<br />
# htpasswd -c /usr/local/etc/icinga/htpasswd.users icingaadmin<br />
New password: miclavesecreta<br />
Re-type new password: miclavesecreta<br />
Adding password for user isingaadmin<br />
<br />
El password que escribio lo debe anotar, osea que creamos icingaadmin/miclavesecreta <br />
<br />
Note que en el primer comando tenemos -c para crear el archivo y en el siguiente no!<br />
<br />
# htpasswd /usr/local/etc/icinga/htpasswd.users guest<br />
New password: guest<br />
Re-type new password: guest<br />
Adding password for user guest<br />
<br />
El password que escribio lo debe anotar, osea que creamos guest/guest<br />
<br />
Note que hemos creado dos usuarios icingaadmin con su respectiva clave y el usuario guest con clave guest<br />
<br />
Editar el archivo de Apache para el sitio de icinga <br />
<br />
# edit /usr/local/etc/apache22/httpd.conf<br />
<br />
Agregar las lineas<br />
<br />
# Modificacion para ICINGA inicio<br />
<br />
<Directory /usr/local/www/icinga><br />
Order deny,allow<br />
Options -Indexes <br />
Deny from all<br />
Allow from all<br />
<br />
# Autenticacion inicio<br />
AuthName "Icinga Access"<br />
AuthType Basic<br />
AuthUserFile /usr/local/etc/icinga/htpasswd.users<br />
Require valid-user<br />
# Autenticacion fin<br />
</Directory><br />
<br />
<Directory /usr/local/www/icinga/cgi-bin><br />
Options ExecCGI<br />
# Autenticacion inicio<br />
AuthName "Icinga Access"<br />
AuthType Basic<br />
AuthUserFile /usr/local/etc/icinga/htpasswd.users<br />
Require valid-user<br />
# Autenticacion fin<br />
</Directory><br />
<br />
ScriptAlias /icinga/cgi-bin/ /usr/local/www/icinga/cgi-bin/<br />
Alias /icinga /usr/local/www/icinga/<br />
<br />
# Modificacion para ICINGA fin<br />
<br />
Reiniciar Apache para que tome los cambios<br />
<br />
# /usr/local/etc/rc.d/apache22 restart<br />
<br />
Creamos los archivos a partir de los de ejemplo<br />
<br />
# cp /usr/local/etc/icinga/cgi.cfg-sample /usr/local/etc/icinga/cgi.cfg<br />
# cp /usr/local/etc/icinga/cgiauth.cfg-sample /usr/local/etc/icinga/cgiauth.cfg<br />
# cp /usr/local/etc/icinga/icinga.cfg-sample /usr/local/etc/icinga/icinga.cfg<br />
# cp /usr/local/etc/icinga/resource.cfg-sample /usr/local/etc/icinga/resource.cfg<br />
# cp /usr/local/etc/icinga/objects/commands.cfg-sample /usr/local/etc/icinga/objects/commands.cfg<br />
# cp /usr/local/etc/icinga/objects/contacts.cfg-sample /usr/local/etc/icinga/objects/contacts.cfg<br />
# cp /usr/local/etc/icinga/objects/notifications.cfg-sample /usr/local/etc/icinga/objects/notifications.cfg<br />
# cp /usr/local/etc/icinga/objects/templates.cfg-sample /usr/local/etc/icinga/objects/templates.cfg<br />
# cp /usr/local/etc/icinga/objects/timeperiods.cfg-sample /usr/local/etc/icinga/objects/timeperiods.cfg<br />
<br />
Verificar las lineas o ajustarlas (note que agregamos ,guest al final, en las lineas 260 y 261)<br />
<br />
# edit /usr/local/etc/icinga/cgi.cfg<br />
<br />
authorized_for_all_services=icingaadmin,guest<br />
authorized_for_all_hosts=icingaadmin,guest<br />
<br />
Editar el archivo de Cinga<br />
<br />
# edit /usr/local/etc/icinga/icinga.cfg<br />
<br />
Comentar la linea colocando un # al inicio, queda asi:<br />
<br />
#cfg_file=/usr/local/etc/icinga/objects/localhost.cfg<br />
<br />
Crear el archivo con los equipos de nuestra compañia (abajo hay un link en Google Drive desde donde puede descargarlo)<br />
<br />
# edit /usr/local/etc/icinga/conf.d/equipment.cfg<br />
<br />
Editar el archivo de contactos de Icinga<br />
<br />
# edit /usr/local/etc/icinga/objects/contacts.cfg<br />
<br />
Ajustamos la linea<br />
<br />
email icinga@localhost ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******<br />
<br />
Por un email valido<br />
<br />
email micorreo@gmail.com ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******<br />
<br />
Verificar que todo esta bien en la configuracion de icinga<br />
<br />
# icinga -v /usr/local/etc/icinga/icinga.cfg<br />
<br />
Iniciar Icinga si la verificacion pasa sin errores<br />
<br />
# /usr/local/etc/rc.d/icinga start<br />
<br />
Performing sanity check of icinga configuration: OK<br />
Starting icinga.<br />
<br />
Para ver el log (luego para parar de ver el log use las teclas Ctl + C)<br />
# tail -f /var/log/icinga/icinga.log<br />
<br />
Otro comando util<br />
<br />
# icingastats -c /usr/local/etc/icinga/conf.d/equipment.cfg<br />
<br />
Ahora que Icinga esta corriendo, para velo, entramos a:<br />
<br />
http://<ipdemiserver>/icinga<br />
<br />
le pedira entrar el usuario guest y la clave guest con los que se puede monitorear los equipos, si inincia con el usuario icingaadmin y la clave miclavesecreta se pueden hacer otros ajustes mas delicados desde el navegador (desactivar alarmas y otras cosas).<br />
<br />
Caputuras de Icinga funcionando :-)<br />
<br />
Icinga Tactical Overview<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-M5K8aZ3Hi_A/T8AT-5B27aI/AAAAAAAABXo/zOI6R3LHWRw/s1600/IcingaTactical.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/-M5K8aZ3Hi_A/T8AT-5B27aI/AAAAAAAABXo/zOI6R3LHWRw/s320/IcingaTactical.png" height="153" width="320" /></a></div>
<br />
Icinga Map<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-uxhLWjlrh7M/T8Ayqn79hvI/AAAAAAAABX8/kW993HUVwK0/s1600/IcingaMap.tiff" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/-uxhLWjlrh7M/T8Ayqn79hvI/AAAAAAAABX8/kW993HUVwK0/s320/IcingaMap.tiff" height="149" width="320" /></a></div>
<br />
Notas:<br />
<br />
En el port icinga 1.7.0_2 se solucionaron unos errores en rutas y permisos que originalmente se detectaron el el port 1.7.0 :-)<br />
<br />
Si quiere aqui estan los archivos de configuracion "equipment.cfg" y "commands.cfg", pero tenga en cuenta que en el primero hay comandos que requieren de nuevos comandos agregados posteriormente en "commands.cfg", por esto si va a usar el primer archivo tambien debe remplazar el archivo original "commands.cfg" de Icinga, baje ambos archivos del siguiente link:<br />
<a href="https://docs.google.com/folder/d/0B-ODrM4HjfLraXpnVnNBVFZNaDg/edit" target="_blank">Google Drive</a><br />
<br />
Adicionalmente se puede modificar en la opcion "notification_period" el valor "24x7" por "workhours" y luego editamos el archivo /usr/local/etc/icinga/objects/timeperiods.cfg para ajustar workhours a nuestro horario de trabajo.<br />
<br />
Opcional (en pruebas):<br />
<br />
Icinga puede guardar la informacion del estado de los equipos en un DB que puede ser MySQL o PostgreSQL, si queremos hacerlo...<br />
<br />
Hay que tener un montor de DB, en nuestro caso usaremos MySQL<br />
<br />
Para activar el soporte de MySQL, al instalar el port debe activar tambien la opcion<br />
<br />
[X] MYSQL "Depend on MySQL"<br />
<br />
Si siguio paso a paso este manual no lo tendra activado. Para activarlo puede parar el servicio, entrar al port, desinstalarlo, activar la opcion e instalarlo nuevamente sin problema<br />
<br />
# /usr/local/etc/rc.d/icinga stop<br />
# cd /usr/ports/net-mgmt/icinga<br />
# make deinstall clean<br />
<br />
# make config<br />
<br />
Options for icinga 1.7.0_2<br />
<br />
Activamos las siguientes opciones<br />
<br />
[X] EMBEDDED_PERL "Enable embedded Perl"<br />
[X] IDOUTILS "Enable IDOUtils"<br />
[X] MYSQL "Depend on MySQL"<br />
<br />
# make install clean<br />
<br />
Note que los comandos que al inicio tienen el $ se ejecutan con un usuario diferente del root<br />
<br />
Crear la DB llamada icinga<br />
<br />
$ mysqladmin -uroot create icinga<br />
<br />
Le damos permisos al usuario icinga con clave icinga en la DB llamada icinga<br />
<br />
$ mysql -uroot -e"GRANT ALL ON icinga.* TO icinga@localhost IDENTIFIED BY 'icinga'" icinga<br />
<br />
Creamos los archivos a partir de los de ejemplo<br />
<br />
# cp /usr/local/etc/icinga/idomod.cfg-sample /usr/local/etc/icinga/idomod.cfg<br />
# cp /usr/local/etc/icinga/ido2db.cfg-sample /usr/local/etc/icinga/ido2db.cfg<br />
<br />
Activar el modulo broker de icinga editando el archivo<br />
<br />
# edit /usr/local/etc/icinga/icinga.cfg<br />
<br />
La linea original (esta opcion esta en la linea 269)<br />
<br />
#broker_module=/usr/local/lib/idomod.so config_file=/usr/local/etc/icinga/idomod.cfg<br />
<br />
La activamos quitando el # del principio, de modo que queda asi<br />
<br />
broker_module=/usr/local/lib/idomod.so config_file=/usr/local/etc/icinga/idomod.cfg<br />
<br />
Importar el esquema de la DB para icinga <br />
<br />
Note que los comandos que al inicio tienen el $ se ejecutan con un usuario diferente del root<br />
<br />
$ mysql --user=icinga --password=icinga icinga < /usr/local/share/examples/icinga/idoutils/db/mysql/mysql.sql<br />
<br />
Hacer que inicie con el sistema editando /etc/rc.conf<br />
<br />
# edit /etc/rc.conf<br />
<br />
Agregar la linea<br />
<br />
ido2db_enable="YES"<br />
<br />
Iniciar ido2db<br />
<br />
# /usr/local/etc/rc.d/ido2db start<br />
<br />
Si nos regresa este error<br />
<br />
Could not bind socket: Address already in use<br />
<br />
Borrar el archivo /var/spool/icinga/ido.sock<br />
<br />
# rm /var/spool/icinga/ido.sock<br />
<br />
Y tratar de iniciar el servicio nuevamente<br />
<br />
# /usr/local/etc/rc.d/ido2db start<br />
<br />
Iniciar Icinga<br />
<br />
# /usr/local/etc/rc.d/icinga start<br />
<br />
Hacer backup de la DB icinga<br />
# mysqldump --user=icinga --password=icinga icinga > /usr/home/backups/icinga.sql<br />
<br />
Importarlo, note que los comandos que al inicio tienen el $ se ejecutan con un usuario diferente del root<br />
<br />
$ mysql --user=icinga --password=icinga icinga < /usr/home/backups/icinga.sql<br />
<br />
Algunos ajustes opcionales:<br />
<br />
statusmap <a href="http://docs.icinga.org/latest/en/configcgi.html">http://docs.icinga.org/latest/en/configcgi.html</a><br />
<br />
# edit /usr/local/etc/icinga/cgi.cfg<br />
<br />
ajustamos la linea<br />
<br />
default_statusmap_layout=5<br />
<br />
la podemos cambiar por 3 (Balanced tree) para que siempre nos muestre de esa forma el mapa.<br />
<br />
Actualizacion<br />
Luego de un tiempo se necesito que dos elementos en icinga reportaran a un email diferente, para hacer esto<br />
<br />
# edit /usr/local/etc/icinga/objects/contacts.cfg<br />
<br />
En la seccion CONTATS agrego al final de icingaadmin las entradas<br />
...<br />
define contact{<br />
contact_name jdoe<br />
use generic-contact<br />
alias John Doe (Sistemas)<br />
<br />
email john.doe@gmail.com<br />
}<br />
<br />
define contact{<br />
contact_name jsmith<br />
use generic-contact<br />
alias John Smith (Sistemas)<br />
<br />
email john.smith@gmail.com<br />
}<br />
<br />
define contact{<br />
contact_name jroe<br />
use generic-contact<br />
alias Jane Roe (Ingenieria)<br />
<br />
email jane.roe@gmail.com<br />
}<br />
<br />
En la seccion CONTACT GROUPS agrego al final de admins las entradas<br />
...<br />
define contactgroup{<br />
contactgroup_name sistemas<br />
alias Soporte Sistemas<br />
members jdoe, jsmith<br />
}<br />
<br />
define contactgroup{<br />
contactgroup_name ingenieria<br />
alias Ingenieria<br />
members jroe<br />
}<br />
<br />
Ejemplo de la entrada para un equipo<br />
<br />
# edit /usr/local/etc/icinga/conf.d/equipment.cfg<br />
<br />
define host{<br />
host_name alpha<br />
alias HP ProLiant ML370G4<br />
icon_image freebsd40.png<br />
icon_image_alt FreeBSD<br />
vrml_image freebsd40.png<br />
statusmap_image freebsd40.gd2 ; El que se ve en el mapa (.gd2 o .png)<br />
#2d_coords x_coord,y_coord ; Example 100,250<br />
2d_coords 100,125<br />
notes Servidor principal<br />
notes_url /glpi<br />
action_url /public<br />
address 192.168.16.1<br />
#parents<br />
hostgroups network-server<br />
check_command check-host-alive<br />
check_interval 5<br />
retry_interval 1<br />
max_check_attempts 5<br />
check_period 24x7<br />
process_perf_data 0<br />
retain_nonstatus_information 0<br />
#contact_groups admins<br />
contact_groups sistemas ; Este solo reporta a sistemas<br />
notification_interval 30<br />
notification_period 24x7<br />
notification_options d,u,r<br />
}<br />
<br />
Si quiero que reporte a sistemas y a ingenieria, la linea contact_groups es asi<br />
<br />
contact_groups sistemas, ingenieria<br />
<br />
O si solo reporta a ingenieria, la linea es<br />
<br />
contact_groups ingenieria<br />
<br />AngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com0tag:blogger.com,1999:blog-6410840638905218654.post-5738897788116988702012-05-22T13:17:00.000-05:002012-05-24T13:18:43.479-05:00PHP5Introducion:<br />
<br />
Instalar PHP5 en FreeBSD para Apache<br />
<br />
Requerimientos:<br />
<br />
* Conexion a Internet <br />
* FreeBSD instalado<br />
* Apache instalado<br />
<br />
* Leer este manual <br />
<br />
El proceso:<br />
<br />
Actualizar el arbol de ports<br />
<br />
# csup -h cvsup16.us.FreeBSD.org -g -L 2 /usr/share/examples/cvsup/ports-supfile<br />
<br />
Instalar el por php5<br />
<br />
# cd /usr/ports/lang/php5<br />
<br />
# make config<br />
<br />
Activar la opcion<br />
[X] APACHE Build Apache module<br />
[ OK ]<br />
<br />
# make install clean<br />
<br />
Crear el archivo test.php<br />
<br />
# edit /usr/local/www/apache22/data/test.php<br />
<br />
Agregar las siguientes lineas:<br />
<br />
<?php<br />
phpinfo();<br />
?><br />
<br />
Gerenar el archivo de configuracion a partir del de ejemplo<br />
<br />
# cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini<br />
<br />
Editar el archivo de apache para activarle PHP<br />
<br />
# edit /usr/local/etc/apache22/httpd.conf<br />
<br />
Desactivo las siguientes lineas:<br />
<br />
#<IfModule dir_module><br />
#DirectoryIndex index.html<br />
#</IfModule><br />
<br />
Agregamos las nuevas:<br />
<br />
# Lineas agregadas para PHP inicio<br />
<IfModule mod_php5.c><br />
DirectoryIndex default.php index.html index.php login.php<br />
</IfModule><br />
<br />
<IfModule mod_php5.c><br />
AddType application/x-httpd-php .php<br />
AddType application/x-httpd-php-source .phps<br />
</IfModule><br />
# Lineas agregadas para PHP fin<br />
<br />
Reiniciar Apache<br />
<br />
# /usr/local/etc/rc.d/apache22 restart<br />
<br />
Verificar el soporte de PHP en Apache<br />
<br />
Entrar con el navegador a:<br />
<br />
http://<serverip>/test.phpAngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com0tag:blogger.com,1999:blog-6410840638905218654.post-49686564479430367392012-05-19T13:16:00.000-05:002014-07-29T14:38:28.084-05:00ApacheIntroduccion:<br />
<br />
Instalar Apache en FreeBSD<br />
<br />
Requerimientos:<br />
<br />
* Conexion a Internet<br />
* FreeBSD instalado<br />
* Leer este manual<br />
<br />
El proceso:<br />
<br />
Actualizar el arbol de ports<br />
<br />
# csup -h cvsup15.us.FreeBSD.org -g -L 2 /usr/share/examples/cvsup/ports-supfile<br />
<br />
Instalar el port de Apache<br />
<br />
# cd /usr/ports/www/apache22<br />
<br />
# make config<br />
<br />
Desactive esta opcion, es un modulo tocapelotas (quite la X), queda asi:<br />
<br />
[ ] UNIQUE_ID Enable mod_unique_id<br />
<br />
# make install clean<br />
<br />
Activar el inicio de Apache con el sistema editando /etc/rc.conf<br />
<br />
# edit /etc/rc.conf<br />
<br />
Agregar la linea<br />
<br />
apache22_enable="YES"<br />
<br />
Iniciar apache<br />
<br />
# /usr/local/etc/rc.d/apache22 start<br />
<br />
El archivo de configuracion donde se crean los sitios<br />
<br />
# edit /usr/local/etc/apache22/httpd.conf<br />
<br />
Los comandos de apache son:<br />
<br />
# /usr/local/etc/rc.d/apache22 start|stop|restart<br />
<br />
Otro comando muy util para hacer que apache relea el httpd.conf luego de hacer un cambio<br />
<br />
# apachectl graceful<br />
<br />
Los logs de apache los puede ver asi <br />
<br />
# tail -f /var/log/httpd-error.log<br />
# tail -f /var/log/httpd-access.log<br />
<br />
Ahora vamos a crear nuestro primer sitio en apache, crearemos misitio<br />
<br />
Editamos el archivo httpd.conf de apache<br />
<br />
# edit /usr/local/etc/apache22/httpd.conf<br />
<br />
Al final del archivo agregamos <br />
<br />
# Modificacion para MISITIO inicio<br />
<br />
<Directory /usr/local/www/misitio><br />
Order deny,allow<br />
Options -Indexes <br />
Deny from all<br />
Allow from all<br />
<br />
Alias /misitio /usr/local/www/misitio/<br />
<br />
# Modificacion para MISITIO fin<br />
<br />
Reiniciamos apache<br />
<br />
# /usr/local/etc/rc.d/apache22 restart<br />
<br />
Creamos el directorio<br />
<br />
# mkdir /usr/local/www/misitio<br />
<br />
Creamos un codigo html basico dentro de misitio<br />
<br />
# edit /usr/local/www/misitio/index.html<br />
<br />
Le agregamos un contenido muy basico<br />
<br />
<p>Hola mundo!</p>
<br />
<br />
Le asignamos el usuario www y grupo www al directorio y su contenido<br />
<br />
# chown -R www:www /usr/local/www/misitio<br />
<br />
Le damos los permisos correctos al directorio y su contenido<br />
<br />
# chmod -R 0755 /usr/local/www/misitio<br />
<br />
# chmod 0644 /usr/local/www/misitio/index.html<br />
<br />
Aqui hay mas informacion sobre los permisos<br />
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/permissions.html <br />
<br />
Para verificar que el sitio este funcionando, entramos a<br />
<br />
http://<IPSERVER>/misitio<br />
<br />
Listo, al entrar debemos ver nuestro Hola mundo!AngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com0tag:blogger.com,1999:blog-6410840638905218654.post-78928210235391611272012-05-18T16:21:00.000-05:002014-11-11T08:34:01.558-05:00Proxy Squid-cacheIntroduccion:<br />
<br />
Instalar Squid-cache en FreeBSD y dejarlo trabajando en modo intercept (transparente)<br />
<br />
Requerimientos:<br />
<br />
* Conexion a Internet<br />
* FreeBSD instalado<br />
* Firewall PF (para proxy transparente)<br />
* Leer este manual<br />
<br />
El proceso:<br />
<br />
<br />
Actualizar el arbol de ports<br />
<br />
# csup -h cvsup15.us.FreeBSD.org -g -L 2 /usr/share/examples/cvsup/ports-supfile<br />
<br />
# cd /usr/ports/www/squid32<br />
<br />
# make config<br />
<br />
IMPORTANTE!<br />
<a href="http://www.squid-cache.org/Versions/v3/3.2/cfgman/http_port.html" target="_blank">Para usar proxy transparente se deben desactivar AUTHENTICATION e IPv6</a><br />
<br />
Options for squid 3.2.3_2<br />
<br />
[X] ARP_ACL Enable ARP/MAC/EUI based authentification<br />
[X] FS_AUFS Enable AUFS (async-io) support<br />
[X] HTCP Enable HTCP support<br />
[X] IDENT Enable Ident lookups (RFC 931)<br />
[X] KQUEUE Enable kqueue(2) support<br />
[X] SNMP Enable SNMP support<br />
[X] TP_PF Enable transparent proxying with PF<br />
[X] WCCP Enable Web Cache Coordination Protocol<br />
[X] WCCPV2 Enable Web Cache Coordination Protocol v2<br />
<br />
[ OK ]<br />
<br />
# make install clean<br />
<br />
Para que Squid-cache pueda trabajar en modo intercept necesita poder leer /dev/pf<br />
<br />
Por defecto /dev/pf solo es accesible para el usuario root<br />
<br />
Verificamos los permisos actuales de /dev/pf<br />
<br />
# ls -al /dev/pf<br />
crw------- 1 root wheel 0, 108 Oct 26 11:01 /dev/pf<br />
<br />
Para darle acceso a Squid-cache<br />
<br />
# edit /etc/devfs.conf<br />
<br />
Agregamos la linea<br />
<br />
# Allow Squid read acess to /dev/pf<br />
own pf root:squid<br />
perm pf 0640<br />
<br />
Reiniciamos devfs<br />
<br />
# /etc/rc.d/devfs restart<br />
<br />
Verificamos los permisos nuevos de /dev/pf<br />
<br />
# ls -al /dev/pf<br />
crw-r----- 1 root squid 0, 108 Oct 26 11:01 /dev/pf<br />
<br />
El archivo de configuracion se ve asi:<br />
<br />
# grep -vE '^#|^;|^$' /usr/local/etc/squid/squid.conf<br />
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network<br />
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network<br />
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network<br />
acl localnet src fc00::/7 # RFC 4193 local private network range<br />
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines<br />
acl SSL_ports port 443<br />
acl Safe_ports port 80 # http<br />
acl Safe_ports port 21 # ftp<br />
acl Safe_ports port 443 # https<br />
acl Safe_ports port 70 # gopher<br />
acl Safe_ports port 210 # wais<br />
acl Safe_ports port 1025-65535 # unregistered ports<br />
acl Safe_ports port 280 # http-mgmt<br />
acl Safe_ports port 488 # gss-http<br />
acl Safe_ports port 591 # filemaker<br />
acl Safe_ports port 777 # multiling http<br />
acl CONNECT method CONNECT<br />
http_access allow localhost manager<br />
http_access deny manager<br />
http_access deny !Safe_ports<br />
http_access deny CONNECT !SSL_ports<br />
http_access allow localnet<br />
http_access allow localhost<br />
http_access deny all<br />
http_port 3128<br />
http_port 3129 intercept<br />
cache_dir ufs /var/squid/cache/squid 1000 16 256<br />
coredump_dir /var/squid/cache/squid<br />
refresh_pattern ^ftp: 1440 20% 10080<br />
refresh_pattern ^gopher: 1440 0% 1440<br />
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0<br />
refresh_pattern . 0 20% 4320<br />
access_log daemon:/var/log/squid/access.log squid<br />
<br />
Crear el directorio<br />
<br />
# mkdir -p /var/squid/cache/squid<br />
<br />
Asignar el directorio al usuario squid<br />
<br />
# chown -R squid:squid /var/squid<br />
<br />
Inicializar el cache<br />
<br />
# squid -z<br />
# 2012/12/04 14:04:45 kid1| Creating Swap Directories<br />
2012/12/04 14:04:45 kid1| /var/squid/cache/squid exists<br />
2012/12/04 14:04:45 kid1| Making directories in /var/squid/cache/squid/00<br />
2012/12/04 14:04:45 kid1| Making directories in /var/squid/cache/squid/01<br />
2012/12/04 14:04:45 kid1| Making directories in /var/squid/cache/squid/02<br />
2012/12/04 14:04:45 kid1| Making directories in /var/squid/cache/squid/03<br />
2012/12/04 14:04:45 kid1| Making directories in /var/squid/cache/squid/04<br />
2012/12/04 14:04:45 kid1| Making directories in /var/squid/cache/squid/05<br />
2012/12/04 14:04:45 kid1| Making directories in /var/squid/cache/squid/06<br />
2012/12/04 14:04:45 kid1| Making directories in /var/squid/cache/squid/07<br />
2012/12/04 14:04:45 kid1| Making directories in /var/squid/cache/squid/08<br />
2012/12/04 14:04:45 kid1| Making directories in /var/squid/cache/squid/09<br />
2012/12/04 14:04:46 kid1| Making directories in /var/squid/cache/squid/0A<br />
2012/12/04 14:04:46 kid1| Making directories in /var/squid/cache/squid/0B<br />
2012/12/04 14:04:46 kid1| Making directories in /var/squid/cache/squid/0C<br />
2012/12/04 14:04:46 kid1| Making directories in /var/squid/cache/squid/0D<br />
2012/12/04 14:04:46 kid1| Making directories in /var/squid/cache/squid/0E<br />
2012/12/04 14:04:47 kid1| Making directories in /var/squid/cache/squid/0F<br />
<br />
Poner la linea para que squid inicie con el sistema<br />
<br />
# echo '# Squid-cache' >> /etc/rc.conf<br />
# echo 'squid_enable="YES"' >> /etc/rc.conf <br />
<br />
Verificar el squid.conf<br />
<br />
# squid -k parse<br />
<br />
Iniciar squid<br />
<br />
# /usr/local/etc/rc.d/squid start<br />
<br />
Ver opciones de squid <br />
# squid -v<br />
<br />
<a href="http://wiki.squid-cache.org/ConfigExamples/Intercept/FreeBsdPf" target="_blank">Un ejemplo para PF en FreeBSD</a><br />
<br />
Colocar la linea en la seccion de NAT de nuestro firewall PF:<br />
<br />
# Redirect and allow outgoing to WWW requests to the squid, but<br />
# not from LAN to my server<br />
rdr pass on $int_if proto tcp from any to !$int_if port www \<br />
-> 127.0.0.1 port 3129<br />
<br />
Para ver el log de navegacion de squid use el comando:<br />
<br />
# tail -f /var/log/squid/access.log<br />
<br />
Para verificar otras cosas, por ejemplo si squid inicia bien<br />
<br />
# tail -f /var/log/squid/cache.log<br />
<br />
Los comandos de squid son:<br />
<br />
# /usr/local/etc/rc.d/squid stop|start|restart|reload<br />
<br />
Si quiere aqui estan los archivos de configuracion:<br />
<a href="https://docs.google.com/open?id=0B-ODrM4HjfLrbl9jdGlJUVBPTzg" target="_blank">Google Drive</a><br />
<br />AngelVhttp://www.blogger.com/profile/12352342880952118842noreply@blogger.com0