Skip to content

Recent Articles

11
Mar

Linux Storage

LVM

  • LVM cannot contain a bootable partition, which means that you’ll need to create a separate /boot partition.
  • Physical volumes The physical disks or partitions that LVM splits into physical extents.
  • Volume groups The collections of physical volumes; the giant pools of storage made up of all the physical extents.
  • Logical volumes LVM has created a virtual hard drive, the volume groups, so it also needs to create virtual partitions –or logical volumes. They can be formatted with a filesystem,used to store data and mounted into the main directory tree, just like normal partitions
  • /etc/fstab: /dev/VolumeGroupName/LogicalVolumeName /home ext4 defaults 0 1
vgextend VolumeGroupName /dev/sda2 # add new physical volume to a volume group
lvextend -L8G /dev/VolumeGroupName/LogicalVolumeName # extend logical volumes within the volume group use the extra available storage just added
resize2fs /dev/VolumeGroupName/LogicalVolumeName # cause an ext4 filesystem to expand to the same size as the newly modified logical volume

pvmove / vgreduce

File System

Btrfs

Btrfs is a new filesystem for Linux, designed to help deal with the large storage systems that are common in data centres and other industrial settings. It provides a strong set of management tools and other advanced features.

Btrfs removes much of the need for LVM and, since all of this is rolled into a single filesystem, with no more partitions or logical volumes to deal with, admin is massively simplified. What’s more, the system is safer – thanks to features such as online filesystem check, checksums, and filesystem mirroring, that other filesystems you would have
used with LVM are lacking.

Rescue

testdisk / photorec

Tools

GParted (partitioning), g4u (disk clone), Partimage, Testdisk (Recover lost partitions and repair boot sectors), Foremost (Recovers files based on their headers and other internal structures)

24
Sep

MySQL Error

phpMyAdmin Import Error:

SELECT `comment`
FROM `phpmyadmin`.`pma_column_info`
WHERE db_name = 'xxx'
AND table_name = ''
AND column_name = '(db_comment)'

#2006 - MySQL server has gone away

» my.ini | max_allowed_packet = 100M

Access Denied for user ‘root@…’:

/usr/libexec/mysqld -u root –skip-grant-tables

9
Aug

WordPress Security

Default  “wp_” as a db prefix, this is a known vulnerability, malicious users can exploit your data easily.

28
Jul

Symfony Xampp Command Line

Control Panel -> System -> Advanced System Settings -> Environment Variables… -> Path -> add “;C:\xampp\php\” -> Create a cmd shortcut:

Read moreRead more

22
Jul

Web Design Cheat Sheets

PHP5 Online Cheat Sheet


ActionScript 2.0 to 3.0 Migration Cheatsheets

Read moreRead more

6
Mar

jQuery DOM

$(‘body :hidden’).show()

$(‘#back-to-top’).parents(‘#footer’).children(‘ul’).find(‘a’)
$(‘.comment ‘).closest(‘.block’).andSelf().filter(‘[class*=level2-], [class^=level3-]‘)

.siblings()
.next()

$(‘img’).wrap(‘<p></p>’)
$(‘img’).unwrap()

.remove()
.empty()
.detach()

.attr()
.removeAttr()
.text()
.val()

6
Mar

jQuery Events

jQuery Events

.click(fn)

$(‘h3.cat-title’).bind(‘click’, catClick) // easier to unbind later
function catClick(evt) {
$(this).parent().childrent(‘div.cat-desc’).slideToggle();
}

$(‘a’).click(function(){
return false;  // prevent redirect
}); Read moreRead more

6
Mar

jQuery Effects

jQuery Effects

.show()
.hide(500)
.toggle()

.fadeOut(500)
.fadeIn(500)
.fadeTo(500, .5)

.slideUp(500)
.slideDown(500)
.slideToggle(500)

.animate({
opacity: 0.4,
left: “+=50px”
}, 1000 );

6
Mar

jQuery Selector

jQuery Selectors

contain: *=
endwith: $=

$(‘:not(li)’)
$(‘.category li:not(:first)’)

$(“p[class]“).css(“border”, “none”);
$(‘tr[class="1"]:first
tr[class="2"]:visible’).size();

$(“ul:has(li[class=a])”)

$(“ul li:nth-child(3)”)
$(‘.left-nav li:even’)

$(“img”, this);
$(this).find(‘img’); Read moreRead more

24
Jan

從上海博物館的青銅器說起

(本文轉載自Tencent CDC BlogRead moreRead more