New Tips

  • Dell omreport keeps returning storage battery charging, on new server

Here is the problem, and a strange way to solve it:

root@server:~# omreport storage battery controller=0 battery=0 
Battery 0 on Controller PERC H700 Adapter (Slot 1)

Controller PERC H700 Adapter (Slot 1)
ID                        : 0
Status                    : Non-Critical
Name                      : Battery 0
State                     : Charging
Recharge Count            : Not Applicable
Max Recharge Count        : Not Applicable
Predicted Capacity Status : Ready
Learn State               : Idle
Next Learn Time           : 30 days 21 hours
Maximum Learn Delay       : 7 days 0 hours
Learn Mode                : Auto

root@digul-ws10:~# omconfig storage battery action=delaylearn controller=0 battery=0 hours=2 days=0
Command successful!

root@server:~# omreport storage battery controller=0 battery=0 Battery 0
Controller PERC H700 Adapter (Slot 1)
ID                        : 0
Status                    : Ok
Name                      : Battery 0
State                     : Ready
Recharge Count            : Not Applicable
Max Recharge Count        : Not Applicable
Predicted Capacity Status : Ready
Learn State               : Idle
Next Learn Time           : 30 days 11 hours
Maximum Learn Delay       : 6 days 20 hours
Learn Mode                : Auto
  • Samba don't follow external symlinks anymore (27/03/2013)
follow symlinks = yes
wide links = yes
unix extensions = no

$ /etc/init.d/samba restart
  • Find lost superblock

If you change the partition table for growing an existing partions. Things can go bad, and you may not be able to mount the partition: “Can't find superblock”. Don't panic . Boot SysRescueCD and run testdisk tool. Ask him to find the superbloc (Analyze), then write the partition table.

  • Linux command-line scanning (sane)
scanimage  --resolution 150 --mode Gray -x 215 -y 297 > image.pnm
  • Encode videos for Nokia 5800
#With h264 Codec:
ffmpeg -i "input.avi" -f mp4 -vcodec libx264 -b 1000k -r 30 -s 320x240 -acodec libfaac -ar 32000 -ab 128k -ac 2 -threads 0 -async 1 -aspect 4:3 "output.mp4" 
#With mpeg4 Codec: 
ffmpeg -i input.avi -f mp4 -vcodec mpeg4 -b 643k -r 23 -s 640x360 -acodec libfaac -ar 32000 -ab 128k -ac 2 -threads 0 output.mp4
  • Shrink ext/LVM partition

After a database cleanup, and optimization, I'd like to get back the unused space on my MySQL partition. This partition is ext3+LVM

# df -h 
...
/dev/mapper/lvm_raid-var_lib_mysql
                      1.6T  611G  941G  40% /var/lib/mysql
...
NB: I want to shrink it to 1T.
# root@server:~# resize2fs /dev/mapper/lvm_raid-var_lib_mysql 800G
resize2fs 1.40-WIP (14-Nov-2006)
Resizing the filesystem on /dev/mapper/lvm_raid-var_lib_mysql to 209715200 (4k) blocks.
The filesystem on /dev/mapper/lvm_raid-var_lib_mysql is now 209715200 blocks long.
# lvreduce -L 1000G /dev/mapper/lvm_raid-var_lib_mysql
NB: logical volume is 20% greater than filesystem at this point... this IS NORMAL.



Filesystem at /dev/mapper/myvg-mypartition is mounted on /mnt/mypartition; on-line resizing required
old desc_blocks = 2, new_desc_blocks = 4
Performing an on-line resize of /dev/mapper/myvg-mypartition to 13107200 (4k) blocks.

The filesystem on /dev/mapper/myvg-mypartition is now 13107200 blocks long.
  • FreeBSD and ext2
kldload ext2fs
pkg_add -r e2fsprogs
fsck.ext2  /dev/da0sX
mount -t ext2fs /dev/da0sX /mnt/location/
  • Tech TV Streams
Just found [[http://dl.tv/]] website.
  • Online resize lvm partition
# aptitude install resize2fs
# lvresize /dev/mapper/myvg-mypartition
# resize2fs /dev/mapper/myvg-mypartition


Filesystem at /dev/mapper/myvg-mypartition is mounted on /mnt/mypartition; on-line resizing required
old desc_blocks = 2, new_desc_blocks = 4
Performing an on-line resize of /dev/mapper/myvg-mypartition to 13107200 (4k) blocks.

The filesystem on /dev/mapper/myvg-mypartition is now 13107200 blocks long.
  • Scripting lftp
vi /tmp/myscript

open myftpserver.mydomain.com  -uMYUSER,MYPASS 
binary
hash
cd /some/place
get somefile.tgz
cd ..

$ lftp -f /tmp/myscript -d  (-d is for debug)

Strike-through Text

Last modified: 2013/04/02 00:00
   
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported