Доки, маны, напоминалки

macbook no sleep with closed lid

Posted on Июнь 29, 2020

Disable Sleeping when the lid is closed running on battery
sudo pmset -b sleep 0; sudo pmset -b disablesleep 1

Re-enable sleeping when the lid is closed running on battery
sudo pmset -b sleep 5; sudo pmset -b disablesleep 0

Remember to re-enable or manually sleep your machine before putting it into a bag. It will get very hot very quickly in an enclosed space.

bad interpreter: No such file or directory

Posted on Апрель 21, 2019

-bash: /blabla.sh: /bin/bash^M: bad interpreter: No such file or directory

apt install dos2unix
dos2unix blabla.sh

Метки записи: , , Нет комментариев

HP LO100 virtual media

Posted on Март 1, 2018


spidernik84 Occasional Advisor

‎07-12-2011 12:58 AM - edited ‎07-12-2011 04:19 AM
Re: DL170e G6 iLO, unable to boot from virtual media

Hello, finally the problem has been solved.

We managed to make the virtual media feature to work from a Windows Server machine located in the same datacenter, thereby skipping all the network.

Seems like the problem could be related to blocked ports AND incompatible OS (we've been using ubuntu throughout the test).

Also, keep in mind that the ISO is successfully mounted only if its name changes to the ip address of your local machine in the virtual media applet (see screenshot).

Also, on our Windows Server we had to mount the ISO TWICE for it to show as correctly mounted.

One more thing: if you're using LO100 you have to use java 1.4.2_13 (exactly that version, not any other, even minor), else the virtual media will keep silently disconnecting.

By the way, the correct ports to open are 5901 TCP and UDP, as stated in HP official bulletin:



Метки записи: , , , , Нет комментариев


Posted on Июль 3, 2017

/usr/lib/systemd/system/ – юниты из установленных пакетов RPM.
/run/systemd/system/ — юниты, созданные в рантайме. Этот каталог приоритетнее каталога с установленными юнитами из пакетов.
/etc/systemd/system/ — юниты, созданные и управляемые системным администратором. Этот каталог приоритетнее каталога юнитов, созданных в рантайме.

Метки записи: , Читать полностью

freebsd pf

Posted on Октябрь 12, 2016


Метки записи: , Нет комментариев


Posted on Август 30, 2016

apt-get install mdadm

mdadm -E /dev/sd[b-c]

fdisk /dev/sdb
linux raid

mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/sd[b-c]1
cat /proc/mdstat

mdadm -E /dev/sd[b-c]1
mdadm --detail /dev/md0

mkfs.ext4 /dev/md0

Setting up RAID 1 (Mirroring) using ‘Two Disks’ in Linux – Part 3

Метки записи: , Нет комментариев

место на диске

Posted on Август 22, 2016

apache пишет в несуществующие логи и забивает диск.
du -sh /* |grep G
lsof | grep REG | sort -k7n | tail

Метки записи: , Нет комментариев

cpanel ipaliases

Posted on Август 4, 2016

service network restart
service ipalises restart

Метки записи: Нет комментариев


Posted on Июль 27, 2016

You should be able to image your disks from a snapshot:

First you wil need to make sure the Vm is not running:
virsh suspend vm
Now you can create a snapshot make sure to adjust the size 100M and the name vm-root-snapshot to your own needs.
lvcreate -L 100M -n vm-root-snapshot -s /dev/sysvg/vm-root
After this you can start the VM again.
virsh resume vm

Now that you have the snapshot you can create the image and delete the snapshot:
dd if=/dev/mapper/sysvg-vm--root--snapshot of=/tmp/vm-root.img bs=1M
lvremove /dev/mapper/sysvg-vm--root--snapshot

The image can be copied to the new server and imported to the LVM on the new server with dd
dd if=/tmp/vm-root.img of=/dev/mapper/sysvg-vm--root bs=1M

Also don't forget to import your XML file.
virsh define /path/to/vm.xml

Метки записи: , , Нет комментариев

cpanel NS bulk update

Posted on Сентябрь 24, 2014

Заменить NS в cpanel: WHM > Basic cPanel & WHM Setup.

Поправить уже существующие зоны:
cp -a /var/named /var/named-backup
perl -pi.bak -e "s/oldip/newip/g" *.db
perl -pi.bak -e "s/olddns/newdns/g" *.db
find /var/named/*.db -mtime -1 -exec perl -pi -e 'if (/^\s+(\d{10})\s+;\s+serial/i) { my $i = $1+1; s/$1/$i/;}' '{}' \;
rndc reload

Метки записи: , Нет комментариев