#imageMagick #jpeg

Image optimization using ImageMagick

Sample script to search a directory and only downsize pictures larger than 4k: for i in $(find IMAGE_DIRECTORY -iname "*.png" -o -iname "*.jpg"); do echo $i ; mogrify -filter Triangle -define filter:support=2 -resize 3840x3840 \ -unsharp 0.25x0.08+8.3+0.045 -dither None -posterize 136 -quality 82 \ -define jpeg:fancy-upsampling=off -define png:compression-filter=5 \ -define png:compression-level=9 -define png:compression-strategy=1 \ -define png:exclude-chunk=all -interlace none -colorspace sRGB $i ; done An article with more details on image magic image optimization can be found here

#linux #nvidia #sabayon

Sabayon – nvidia-drivers with old radeon

If You have an older nvidia graphics card you may run into problems trying to install/use Sabayon linux. For example : 01:00.0 VGA compatible controller: NVIDIA Corporation GT218 [GeForce 210] (rev a2) If you get an error during Sabayon live CD install, try to boot with nvidia kernel module disabled. Edit the kernel parameters at the boot menu, adding: modprobe.blacklist=nvidia xdriver=vesa The newest binary nvidia drivers may not support you card if it is to old. ...

#magento #sql

Magento special price SQL

Get sepcial prices using SQL: SELECT * FROM `catalog_product_entity_decimal` as `price` INNER JOIN `eav_entity_type` AS `entity` ON `price`.`entity_type_id` = `entity`.`entity_type_id` INNER JOIN `eav_attribute` AS `attribute` ON `price`.`attribute_id` = `attribute`.`attribute_id` WHERE `entity`.`entity_type_code` = 'catalog_product' AND `attribute`.`attribute_code` = 'special_price' AND `price`.`value` IS NOT NULL ORDER BY `price`.`entity_id` DESC Update special prices in magento using sql UPDATE `catalog_product_entity_decimal` AS `price` INNER JOIN `eav_entity_type` AS `entity` ON `price`.`entity_type_id` = `entity`.`entity_type_id` INNER JOIN `eav_attribute` AS `attribute` ON `price`. ...

#linux #mdamd #raid

Add a drive to raid1

First get information about the raid array: cat /proc/mdstat Then get information about the drive you’re going to add fdisk -l /dev/DISK_TO_ADD If there are any partitions, delete them and create a one new primary partition with type fd – Auto RAID Add the prepared drive to the array: mdadm --add /dev/RAID /dev/DISK_TO_ADD And expand it: mdadm --grow /dev/RAID --raid-devices= N+1 # N - the number of drives in the raid array before the expansion Seat comfortable and watch the raid being rebuilded: ...