Posts Tagged tips

Ubuntu tips: grub rescue and apparmor

Installed Ubuntu on Old laptop for testing new thing like Docker. met 2 issue.

Issue 1. Update the disk partition table caused the grub confused.
I have 4 slice of my harddisk, /dev/sda1 for Windows. /dev/sda5 for windows 2nd partition. /dev/sda6 for Ubuntu./dev/sda7 for Ubuntu swap.
when I need more space for linux, I remove /dev/sda5. then /dev/sda6 become /dev/sda5 …. that confused grub. because grub still hold the record /dev/sda6 is the linux partition.

Fix: grub rescue>ls
grub rescue>set
Read the rest of this entry »

,

No Comments

syslog simple notes

configure the syslog send to central log server

Reminder:
For historical reasons, the key, not a simple blank space, is used to define white space between the selector on the left side of the line and the action on the right side. Throughout the Log Analysis configuration documents, we’ve used the to remind you of this — but of course, when you look at the file, you’ll only see white space.

# Solaris
*.debug;mail,lpr,news,uucp,local0,local1,local2@remote_log_server
# Linux
*.crit,auth.*,mark.*,user.notice,local3.*,local5.*,local6.*,local7.*,syslog.*,authpriv.*,daemon.*@remote_log_server

# Bounce syslog
Read the rest of this entry »

No Comments

(Solved) sftp: Received message too long

when you connect by ssh. it works fine. but doesn’t work with sftp ?

check your ~user/.bashrc or ~user/.profile or ~user/.cshrc anything related with your environment.

remove the echo from above files.

addons: check free memory on Solaris without top
vmstat 1 2 | tail -1 | awk '{printf "%d%s\n", ($5*4)/1024, "MB" }'

No Comments

Quick Ref for XSCF console

Final tips: man intro ; then man

List all domain
XSCF> showdomainstatus -a

Connect to a domain
XSCF> console -d domainhere

Forcely to connect a domain
XSCF> console -d domainhere -f

View an connected console
XSCF> console -d domainhere -r
Read the rest of this entry »

,

No Comments

Tips: how to add new disk to existing VG in Lvm2

We added new Hard disk. need add it to existing DG

take sdb as newly added disk

Step1: Format new disk and label as LVM disk
fdisk /dev/sdb
n -> p -> 1 -> return twice -> t -> 8e -> w

Step2: Create FS on new disk
mkfs.ext3 /dev/sdb1

Step3: Create as PV
pvcreate /dev/sdb1
Read the rest of this entry »

,

No Comments

Some tips: Vsftpd configuration

Vsftpd tips:

All following update /etc/vsftpd/vsftpd.conf

How to change the default public root ?
anon_root=/the/path/you/want

I don’t want let my firewall too open. then define the min/max port.
pasv_min_port=60000
pasv_max_port=65000

iptable setting. 20 is for data
# for FTP
-A INPUT -m state –state NEW -m tcp -p tcp –dport 20 -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp –dport 21 -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp –dport 60000:65000 -j ACCEPT

Vsftp default turn Passive on, How to disable it ?
pasv_enable=NO

,

No Comments

oracle:dbca hang when click finish

this issue happen when you install Oracle with Creating DB. or use dbca to create DB.

Env, use Xming as X server. and foward Oracle X to Xming.
$export DISPLAY=192.168.1.103:0.0
$dbca
Warning: Cannot convert string “-b&h-lucida-medium-r-normal-sans-*-140-*-*-p-*-iso8859-1” to type FontStruct

Note, the Warning is the killer. which stopped dbca go foward

Read the rest of this entry »

,

No Comments

Solaris SVM usage step by step

Notes: need create svm env for Prod patch test. actually zfs is much convinent now. still the requirement issue. we can’t take advantage of zfs in Solaris 9/8

Step 1.
create VM with 2 drives. c0t0d0 & c0t1d0

Step 2.
Duet to hardware limit, we use x86, Install Solaris 10 with option 4. install with Text console. we install OS on one disk

Step 3.
Create SVM
Read the rest of this entry »

,

No Comments

Grub2: fix dual boot issue

Trying boot from livecd to fix the dual boot issue.
ubuntu@ubuntu:~$ sudo grub-install /dev/sda
/usr/sbin/grub-probe: error: cannot find a device for /boot/grub (is /dev mounted?).

Solution:
set the /boot/grub path
root@ubuntu:~# mkdir /a; mount /dev/sda1 /a # sda1 is the root you installed linux
root@ubuntu:~# grub-install /dev/sda –boot-directory=/a/boot/grub
Installation finished. No error reported.

,

No Comments

how to fix ‘who -r’ shows nothing

OS: Solaris 9.
Issue: who -r won’t give you the running level. so the pkgadd won’t work.
myhost1:~ root # who -r # shows no output

Solution:
check the /var/adm/utmpx, maybe the file has been corrupted
myhost1:~ root # cd /var/adm
myhost1:adm root # vi u1.log
# paste the following content.
system boot 0 2 0000 0000 1315335814 0 0 0 Tue Sep 6 20:03:34 2011
run-level 3 0 1 0063 0123 1315335839 0 0 0 Tue Sep 6 20:03:59 2011
rc2 s2 1262 8 0000 0000 1315335885 0 0 0 Tue Sep 6 20:04:45 2011
rc3 s3 3938 8 0000 0000 1315335915 0 0 0 Tue Sep 6 20:05:15 2011
Read the rest of this entry »

,

No Comments