Cisco | Linux | Mandriva | Centos | FreeBSD | GNS3 | Windows 2003 | RedHat | LVM | Rhev 3
Friday, June 15, 2012
Postgresql 9 - some reminder
1. Grant select only to a certain user on tables.
psql databasename
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonlyuser;
Tuesday, May 29, 2012
A note in RHEV installation
I have 1 rhevm and 3 rhevh. Storage is Dell Compellent.
After redhat fix the 512Bytes limit, i should be able now to mount the iscsi store, so there should be a detailed process at storage it self so that all of the hypervisor will be able to become spm or able to connect to the storage pool immediately once the existing spm becomes on maintenance mode.
At the Storage, a server cluster should be created, then join all the rhevh as member. Go to all the rhevh and make sure that you will be able to login manualy on the iscsi LUN advertised by the storage so that HBA will be available on the servers at the cluster. Then all member should have been map on the volume intended as the storage for the rhevh.
at the rhevh, discover first the iscsi.
iscsiadm --mode discoverydb --type sendtargets --portal 192.168.1.1 --discover
assuming that the ip of storage iscsi is 192.168.1.1
then login.
iscsiadm -m node -l ---> it will login to all discovered portal.
then go back at the rhevm and try to activate rhevh, it should be able to become an SPM now.
After redhat fix the 512Bytes limit, i should be able now to mount the iscsi store, so there should be a detailed process at storage it self so that all of the hypervisor will be able to become spm or able to connect to the storage pool immediately once the existing spm becomes on maintenance mode.
At the Storage, a server cluster should be created, then join all the rhevh as member. Go to all the rhevh and make sure that you will be able to login manualy on the iscsi LUN advertised by the storage so that HBA will be available on the servers at the cluster. Then all member should have been map on the volume intended as the storage for the rhevh.
at the rhevh, discover first the iscsi.
iscsiadm --mode discoverydb --type sendtargets --portal 192.168.1.1 --discover
assuming that the ip of storage iscsi is 192.168.1.1
then login.
iscsiadm -m node -l ---> it will login to all discovered portal.
then go back at the rhevm and try to activate rhevh, it should be able to become an SPM now.
Thursday, May 17, 2012
Testing DD to write file to disk
Testing DD to write file to disk.
time sh -c "dd if=/dev/zero of=ddfile1 bs=8k count=200000"
-will write 1.6G of file see output below.
time sh -c "dd if=/dev/zero of=ddfile1 bs=8k count=200000"
200000+0 records in
200000+0 records out
1638400000 bytes (1.6 GB) copied, 7.48931 s, 219 MB/s
Tuesday, May 15, 2012
iptables NAT notes
I have an IP that I need to exclude on the masquerading, after google, this is what been functional. 10.254.1.87 need to bypass NAT. Below are the entry, the rest of the 10.254.x.x should be NAT.
iptables -A POSTROUTING -t nat -s 10.254.1.87/255.255.255.255 -j ACCEPT
#
iptables -A POSTROUTING -t nat -s 10.254.0.0/255.255.0.0 -d 192.168.0.0/255.255.0.0 -o eth0 -j MASQUERADE
iptables -A POSTROUTING -t nat -s 10.254.1.87/255.255.255.255 -j ACCEPT
#
iptables -A POSTROUTING -t nat -s 10.254.0.0/255.255.0.0 -d 192.168.0.0/255.255.0.0 -o eth0 -j MASQUERADE
Well, just copied the information from this link. Thanks!
Monday, January 30, 2012
Changing IP Address of Cisco AP c1260 Gigabit Interface
Changing IP Address of Cisco AP c1260 Gigabit Interface
Well, I need to put it here so I may not forget, there are still other AP that I have not yet set the IP.
I able to login on enable mode, and the command to configure the IP is..
lwapp ip or try lwapp ? for the succeeding commands / parameters.
Well, I need to put it here so I may not forget, there are still other AP that I have not yet set the IP.
I able to login on enable mode, and the command to configure the IP is..
lwapp ip or try lwapp ? for the succeeding commands / parameters.
Friday, January 27, 2012
Duplicating a copy of schema to another schema name on an existing postgresql database
Problem: Need to duplicate the content of say schema001 inside a DB name dbtest001 to a new schema with name schema999.
Specs: Postgres 8.2.17
Solution:
1. Login as root, su - postgres
2. create a backup first of the DB dbtest001, command below:
pg_dump -U postgres dbtest001 -f /tmp/dbtest001-backup.sql
3. psql dbtest001
4. We need to rename the schema001 by alter command:
SCHEMA schema001 RENAME TO schema999;
then control d to exit inside psql.
5. After renaming it to the new schema name, dump the database schema only for the particular schema.
pg_dump -U postgres dbtest001 --schema=schema999 --schema-only -f /tmp/schema999.sql
6. Rename back the schema999 to its original name - schema001.
psql dbtest001
SCHEMA schema999 RENAME TO schema001;
7. Now create schema999
CREATE SCHEMA schema999;
control d to exist again from psql console.
8. Now restore the dumped file on the database.
psql -U postgres -d dbtest001 < /tmp/schema999.sql
The schema999 should now been populated with the content of schema001.
-Ohbet
Edit:
01302012
There is a request to do this on a live system, so I cannot rename the schema, and for searching, some mentioned the dump the original schema to a file, rename the schema name on that file to a new name, here im using sed to rename then create the new schema on the DB and restore the dumped file.
1. Of course, create a backup first. - see 1 above
2. Dump the existing schema.
pg_dump -U postgres dbtest001 --schema=schema001 --schema-only -f /tmp/schema001.sql
3. Rename the schema001 entry on that file and dump in on another file named schema999.
sed 's\schema001\schema999\g' /tmp/schema001.sql > /tmp/schema999.sql
4. psql dbtest001
5. Create the new schema.
CREATE SCHEMA schema999;
6. Dump the edited schema named schema999.sql
psql -U postgres -d dbtest001 < /tmp/schema999.sql
Note: This is the same result as doing the above, the advantage is you dont need to rename the schema, since its a live system.
Specs: Postgres 8.2.17
Solution:
1. Login as root, su - postgres
2. create a backup first of the DB dbtest001, command below:
pg_dump -U postgres dbtest001 -f /tmp/dbtest001-backup.sql
3. psql dbtest001
4. We need to rename the schema001 by alter command:
SCHEMA schema001 RENAME TO schema999;
then control d to exit inside psql.
5. After renaming it to the new schema name, dump the database schema only for the particular schema.
pg_dump -U postgres dbtest001 --schema=schema999 --schema-only -f /tmp/schema999.sql
6. Rename back the schema999 to its original name - schema001.
psql dbtest001
SCHEMA schema999 RENAME TO schema001;
7. Now create schema999
CREATE SCHEMA schema999;
control d to exist again from psql console.
8. Now restore the dumped file on the database.
psql -U postgres -d dbtest001 < /tmp/schema999.sql
The schema999 should now been populated with the content of schema001.
-Ohbet
Edit:
01302012
There is a request to do this on a live system, so I cannot rename the schema, and for searching, some mentioned the dump the original schema to a file, rename the schema name on that file to a new name, here im using sed to rename then create the new schema on the DB and restore the dumped file.
1. Of course, create a backup first. - see 1 above
2. Dump the existing schema.
pg_dump -U postgres dbtest001 --schema=schema001 --schema-only -f /tmp/schema001.sql
3. Rename the schema001 entry on that file and dump in on another file named schema999.
sed 's\schema001\schema999\g' /tmp/schema001.sql > /tmp/schema999.sql
4. psql dbtest001
5. Create the new schema.
CREATE SCHEMA schema999;
6. Dump the edited schema named schema999.sql
psql -U postgres -d dbtest001 < /tmp/schema999.sql
Note: This is the same result as doing the above, the advantage is you dont need to rename the schema, since its a live system.
Thursday, January 5, 2012
Fedora 16 boot problem
Problem: When I accidentally hit the recovery boot process of HP540 Laptop, fedora 16 grub menu wiped out. When restarted and cancelled the Recovery process, it will directly boot to XP, no grub menu.
Setup: Dual boot with Windows XP.
Solution:
I have still the copy of Fedora 16 re-imaged on my USB, I boot the laptop using the USB and make the repair from there.
1. Open terminal shell.
2. Do fdisk -l to find out what disk does the laptop has, on mine, its /dev/sda as the main disk.
3. Find the /boot partition, mine is at /dev/sda3 since I created a separate mount for it
4. mount /dev/sda3 /boot - this will mount your actual /boot on the live system.
5. run the command grub2-install /dev/sda
6. reboot, on mine, it successfully restored the grub and able to get back to my fedora 16 system.
Setup: Dual boot with Windows XP.
Solution:
I have still the copy of Fedora 16 re-imaged on my USB, I boot the laptop using the USB and make the repair from there.
1. Open terminal shell.
2. Do fdisk -l to find out what disk does the laptop has, on mine, its /dev/sda as the main disk.
3. Find the /boot partition, mine is at /dev/sda3 since I created a separate mount for it
4. mount /dev/sda3 /boot - this will mount your actual /boot on the live system.
5. run the command grub2-install /dev/sda
6. reboot, on mine, it successfully restored the grub and able to get back to my fedora 16 system.
Labels:
boot problem,
fedora16,
linux boot problem
Subscribe to:
Posts (Atom)