Jul
14
2010
0

How to add multiple port listen SSH on FreeBSD

The way to do is:

1) Edit sshd config “/etc/ssh/sshd_config"

vi /etc/ssh/sshd_config

2) Uncomment the line “# Port 22″ and add new lines according to how many listener ports you wants to be available for the SSH service on your machine.

In this example we wants to add a new listener for port 10022 and still uses the default ssh port 22, so the line should be like:

Port 22
Port 10022

3) Save the config file and restart the SSHD

/etc/rc.d/sshd restart

- Also sometimes is important to allow just some users, so for that feature you need to uncomment or add the line

Multiple users should be listed on the same line

AllowUsers admin1@192.168.1.32 admin2

And reload that changes after save the config file executing:

/etc/rc.d/sshd reload
 

Source: FreeBSD ssh

Multiple users should be listed on the same line, like so:

AllowUsers root@192.168.1.32 admin

Written by doutdex in: FreeBSD,Unix | Tags: , , ,
Jul
14
2010
0

How to set static IP on Freebsd

1) Edit config file

vi /etc/rc.conf

2) Depends how many interfaces exist is possible to set each one for (em0, em1em2, em…)

#Interface 1 with default gateway for 192.168.0.1
ifconfig_em0="inet 192.168.0.10 netmask 255.255.255.0"
 defaultrouter="192.168.0.1"

#Interface 2
ifconfig_em1="inet 192.168.2.10 netmask 255.255.255.0"

3) Save that file “rc.conf” and restart network init

# /etc/rc.d/netif restart && /etc/rc.d/routing restart

Written by doutdex in: FreeBSD | Tags: , , ,
Jul
11
2010
0

How to install Samba server on red hat or fedora linux server

Triying to share files to windows server by network, one way is using a samba server.

sudo yum install samba samba-client

Edit config file, edir the [glocal] config setting the WORKGROUP, and the networks interfaces allow to the samba service and on the end of the config file  check the access for the share files mappping. Remenber that the shared files has to be permission for the group.

sudo gedit /etc/samba/smb.conf

Create a samba user with an already user from the OS linux

sudo smbpasswd -a OLD_USER

Start samba service

sudo /etc/init.d/smb start

Check startup Samba service

/sbin/chkconfig --list smb

Enable samba service in startup server (just in case)

Enable samba service on FIrewall

system-config-firewall

Enable samba service on SELinux, go to Boolean Menu and enable samba

 system-config-selinux

Test Samba access from localhost with OLDUSER

smbclient -L localhost -U OLDUSER

Written by doutdex in: Centos,Fedora,Linux,Red Hat | Tags: , , , ,
Apr
19
2010
1
Apr
16
2010
0

Share Internet using Fedora – NAT like a gateway to outside access

Muchos, creo yo, querrán compartir la salida a Internet con alguna pequeña subred que posean en su casa (1 o más equipos), y eso es lo que hace un router, aquí detallaré los pasos seguidos con Fedora para dejarlo como router.

Para efectos que se entienda este ejemplo, tengan en cuenta que el PC tiene dos tarjetas de red, eth0 que esta conectada a Internet y que esta configurada como dhcp-client , ip fija, red de marcado, etc… y eth1 que tiene IP fija 192.168.0.1 por la que convidaremos Internet a la subred.

(more…)

Written by doutdex in: Fedora,Linux | Tags: ,
Apr
15
2010
0

Fedora Boot process

Fedora – The Boot Process

Fedora 2 boots is the usual Red Hat way. Its initscripts are more or less similar in the various RedHat versions, as it often happens when a process is tested and mature enought to not need particular changes.

Boot Loader
Fedora’s default boot loader is Grub, the directory /boot/grub/ contains all the configuration files and the binaries.

(more…)

Written by doutdex in: Fedora,Linux | Tags: , , ,
Apr
14
2010
0

Modules Linux

- List available modules in your linux distribution

find /lib/modules/$(uname -r)

- Load a module

modprobe MODULENAME

Written by doutdex in: Uncategorized | Tags: , ,
Apr
11
2010
0

Cómo saber la distribuciíon y versión de linux en tu PC

Simplemente abre una consola y ejecuta:
cat /etc/issue

Written by doutdex in: Linux | Tags:
Mar
29
2010
0

Certificación en empresas (Company Certification)

El mundo actual hace que cada vez más exista una mayor competencia entre compañías de toda índole haciendo que un cliente empresarial ante la eventual búsqueda de algún producto o servicio no pueda decirdirse por completo por una empresa en particular dentro de un grupo de empresas que ofrecen el mismo producto o servicio. Es por eso que tanto sectores privados o de gobierno han tratado de generar pautas para poder identificar y diferenciar a las empresas que no cumplen ciertas bases que permiten entregar una mayor confianza a la hora de firmar acuerdos y/o contratos, por ejemplo podría se el caso de una empresa relativamente nueva que se encuentre recién integrándose al mercado competitivo mundial y necesita dar una imagen de seguridad a sus futuros clientes, por tal motivo a continuación menciono algunas de las certificaciones empresariales más solicitadas al momento de negociar en el mercado internacional:

  • ISO 9001:2008
  • HACCP

Written by doutdex in: Uncategorized |
Oct
10
2009
0

Como eliminar o resetear una contraseña de usuario de Windows XP o Vista desde Ubuntu Linux

Bueno a más de alguno le debe haber pasado que le puso una clave al usuario del windows y se le olvida, pues bueno aquí detallo como hacerlo desde ubuntu utilizando “chntpw”:

chntpw – utility to overwrite Windows NT/2000 SAM passwords.

En el caso que no tengas ubuntu instalado en alguna particion de tu PC, descárga in liveCD y una vez que entres a Ubuntu abres una consola (terminal) yendo a Aplicaciones->Accesorios->Terminal

Written by doutdex in: Trade |
Jul
29
2009
0

MySQL ERROR 1005 (HY000): Can’t create table ‘NameTable.frm’ (errno: 150)

This error 150 means “MySQL error code 150: Foreign key constraint is incorrectly formed”

So the common problem occurs if you try to create a new table with a foreign key without the table source FK (the source table doesn’t exist into DB ), the solution is create first the table source of the FK and then the another one.
or
Disable constraints check with:
SET FOREIGN_KEY_CHECKS = 0;

To enable check constraints
SET FOREIGN_KEY_CHECKS = 1;

Written by doutdex in: Base de Datos | Tags:
Jul
29
2009
0

Adodb PHP simple access to MySql – Oracle – Interbase

PHP’s database access functions are not standardised. This creates a need for a database
class library to hide the differences between the different databases (encapsulate the
differences) so we can easily switch databases.

Requires PHP4. Based on the best ideas of PEAR, phpdb and Microsoft’s ADO.

MySQL Usage:

include(‘adodb.inc.php’);
ADOLoadCode(‘mysql’);
$conn = &ADONewConnection();
$conn->PConnect(‘localhost’,'userid’,'password’,'database’);
$rs = $conn->Execute(‘select * from table’);
rs2html($rs); /* recordset to html table */

Oracle Usage:

include(‘adodb.inc.php’);
ADOLoadCode(‘oracle’);
$conn = &ADONewConnection();
$conn->PConnect(”,’scott’,'tiger’);
$rs = $conn->Execute(‘select * from table’);
rs2html($rs); /* recordset to html table */

Interbase Usage:

include(‘adodb.inc.php’);
ADOLoadCode(‘ibase’);
$conn = &ADONewConnection();
$conn->PConnect(‘c:\ibase\employee.gdb’,'sysdba’,'masterkey’);
$rs = $conn->Execute(‘select * from table’);
rs2html($rs); /* recordset to html table */

http://php.weblogs.com/adodb

Written by doutdex in: Uncategorized | Tags: ,
Jul
28
2009
0

UNIX Crontab

Introduction

cron is a utility that you can use to schedule and automate tasks. By defining items in the cron table, called crontab, you can schedule any script or program to run on almost any sort of schedule.

For example, run a program each day 5 minutes after midnight on mondays, wednesdays and fridays. Or schedule something to run every five minutes, or once a month.

Basics

Each user has their own crontab, the scheduled scripts run as that user take this in account with regards to permissions. To edit the crontab use the following command:

$ crontab -e

You can list what your currnet crontab is using the following command:

$ crontab -l

Crontab Format
The following is the format entries in a crontab must be. Note all lines starting with # are ignored, comments.

Written by doutdex in: Uncategorized |
Jul
12
2009
1

Timestamp en php y mysql

Es algo común tener que estar guardando fechas en la base de datos, sin embargo, es recomendable definir cual será la fuente para la base del tiempo, es decir, puede que pase que existen dos servidores el primero que mantiene a la aplicación y el segundo que tiene a la base de datos y podría pasar en el caso que no estén sincronizados por un servidor npt que el tiempo difiera y en el caso más pesimista hasta que en una haya cambiado la zona horaria y en el otro no.
Esto pasa al momento de obtener el tiempo para guardarlo en la base de datos, en el caso que obtengamos el tiempo usando una función en PHP estaremos obteniendo el tiempo del servidor que mantiene a la aplicación PHP, en el caso que dentro del QUERY la función NOW() esta corresponde a MYSQL y en este caso se retornala fecha y tiempo del servidor de la base de datos.

Lo correcto es definir al sistema u aplicación bajo uno de los dos para el efecto de llevar el tiempo y zona correcta.

CASO PHP:

Al crear dentro de una tabla MYSQL un campo del tipo DATETIME
Para poder insertar la fecha y tiempo en el formato (por defecto) correcto de MySQL usando PHP se hace con

Guardar en MySQL usando función de tiempo PHP
< ?
date(‘Y-m-d H:i:s’, time());
?>

Recuperar fecha MySQL en una variable PHP

Se debe usar la función srttotime
$phpdate = strtotime( $fechaFromMySQL );

CASO BD:
En este caso dentro del insert en el lugar del valor del campo datetime se utiliza la funcion now()

ejm:
INSERT INTO usuario VALUES ( ‘juan’,'perez’,now());

Referencias:

bigroom


Written by doutdex in: Uncategorized | Tags: , , ,
Jun
20
2009
0

Backup database -base de datos- mysql en archivo con cron con timestamp date fecha

Amigos un ejemplo practico de respaldar una base de datos:

Comandos:
1) Editar el archivo de crones para el usuario
crontab -e
2) Agregar una línea indicando cada cuanto se va ejecutar, para este ejemplo puntual el cron se ejecutará semanalmente todos los días Lunes a las 10:30 de la mañana.
30 10 * * mon date=`date “+%Y%m%d%H%M”`;mysqldump –host DOMAINDB -u USERNAME -pPASSWORD BDNAME >/RUTADESTINO/backupBD_$date.sql

El resultado es el backup de una BD con nombre “BDNAME” es un host remoto de mysql “DOMAINDB” con usuario “USERNAME” y clave “PASSWORD”, este backup se guarda en un archivo de texto con un nombre y la fecha tipo timestamp quedando asi:
backupBD_200906201008.sql

Written by doutdex in: Base de Datos,Linux,Mysql,Ubuntu,Unix | Tags: , , ,
Navigation »

TheBuckmaker.com Wordpress Themes | Geld von Privat, Streaming Audio