Kerya techblog

Most Read Posts

  • Gentoo mail (postfix + postfixadmin + dovecot + amavisd-new + roundcube)
  • Zabbix - no such instance currently exists at this oid
  • LVM cant Boot - ALERT /dev/mapper/ubuntu--vg-root does not exist DROPPING to Shell -
  • liquidsoap-1.1.1 gentoo install
  • Laravel manual user register
  • Gentoo: php 5.6.0 + pecl-memcached 2.2.0 install script
  • Zabbix APC Smart UPS monitoring on FreeBSD with snmp
  • Squid 3.4 debian 7 install script
  • Подключение Foxgate S6224-S2 Ubuntu minicom
  • Abills
  • exim+dovecot+postfixadmin+clamav+spamassassin on FreeBSD
  • Openmeetings 2.1.1 Ubuntu 12.04.2 installation
  • libtool version mismatch pecl gentoo
  • Securing NTP
  • FreeBSD 9 ossec setup errors fix
  • fix for - corrupted record for package (pkgdep line without argument), ignoring
  • snmpd less verbose log FreeBSD (Connection from UDP messages)
  • Mikrotik no-ip ddns update script
  • Скопировать права mysql gentoo
  • mysql backup scripts
  1. Вы здесь:  
  2. Home
  • Home
  • Все статьи

Перенос Ubuntu с MBR на GPT

Подробности
Автор: Kirill

Возникла необходимость переноса системы на SSD, с таблицей GPT и корнем на LVM.

Разметка :

1. Раздел под загрузчик (ESP) - 300Mb. Это с запасом, для загрузчика одной систему 100 - с головой.

2. Раздел /boot - 3Gb. Это с запасом, для нескольких версий ядра будет достаточно 512-1024М.

3. Раздел LVM - всё остальное пространство.

Монтируем свежесозданные разделы, чрутимся:

 

Копируем файлы с исходной системы на новый диск.

Для загрузки будет использоваться grub-efi, grub-pc удаляем.

Mysql dump grants (аналог pt-show-grants)

Подробности
Автор: Kirill
#!/bin/sh
for U in `mysql -e "SELECT DISTINCT CONCAT(\"'\", user, \"'\",\"@\", \"'\", host, \"'\") FROM mysql.user;" | grep -v 'CONCAT('`; do echo "## grants for $U ##" ; mysql -e "show grants for $U" | grep -v "Grants for " | awk '{print $0";"}' ; done

 

Оптимизация изображений (pagespeed)

Подробности
Автор: Kirill

# cd <images_folder_orig>

# for IMAGE in $(find . -regextype posix-extended -regex '.*\.(jpg|jpeg|png)'); do jpegtran -copy none -progressive $IMAGE > ./optimized/$IMAGE ; done

# cd .. ; mv  <images_folder_orig> <images_folder_orig>.backup ; ln -s optimized/ <images_folder_orig>

Compilation/installation scripts (apache, php, etc.)

Подробности
Автор: Kirill

apache compilation

-----------------------------------------------------------------------

#!/bin/bash

version='2.4.12'
pushd /usr/src/
if [ ! -f /usr/src/httpd-${version}.tar.bz2 ]; then
    wget http://apache.volia.net/httpd/httpd-${version}.tar.bz2
fi
rm -rf /usr/src/httpd-2.4.12
tar xvf httpd-${version}.tar.bz2
cd /usr/src/httpd-${version}
/usr/bin/make clean
./configure \
    --prefix=/usr/local/apache-2.4 \
    #   --with-apr=/usr/local/apr-1.4.8 \
    #   --with-apr-util=/usr/src/apr-util-1.5.2

    /usr/bin/make -j8
    /usr/bin/make install

    #/usr/src/compile-mod_umask.sh
    #/usr/local/apache-2.4/bin/apxs -a -i -c /usr/src/mod_umask/src/mod_umask.c
popd

---------------------------------------------------------------------------------

php compilation :

---------------------------------------------------------------------------------

#!/bin/bash

version='5.6.9'

_wget='/usr/bin/wget'
_rm='/bin/rm'
_tar='/bin/tar'
_make='/usr/bin/make'

if [ ! -f /usr/src/php-${version}.tar.bz2 ] ; then
    ${_wget} http://ua2.php.net/distributions/php-${version}.tar.bz2
fi
pushd /usr/src/
${_rm} -rf php-${version}
${_tar} xvf php-${version}.tar.bz2

cd /usr/src/php-${version}
${_make} clean
./configure \
        --prefix=/usr/local/php-5.6 \
        --with-apxs2=/usr/local/apache-2.4.12/bin/apxs \
        --with-config-file-scan-dir=/usr/local/php-5.6/etc/ext-active \
        --with-mysql=/usr \
        --with-mysqli \
        --enable-dba \
        --enable-intl \
        --with-pdo-mysql=mysqlnd \
        --with-bz2 \
        --with-gd \
        --with-gettext \
        --with-zlib \
        --enable-zip \
        --enable-opcache \
        --enable-fpm \
        --enable-mbstring \
        --with-curl \
        --with-mcrypt

${_make} install -s

popd

-------------------------------------------------------

phpredis install script (gentoo, php 7)

--------------------------------

#!/bin/bash

php_ver='7.0'
if [ -d phpredis ]; then
    rm -rf phpredis
    git clone https://github.com/phpredis/phpredis.git
fi
cd phpredis
git checkout php7
/usr/lib64/php${php_ver}/bin/phpize
aclocal; libtoolize --force; autoheader; autoconf
PATH=/usr/lib64/php${php_ver}/bin/:$PATH ./configure
make
make install
if [ -f /etc/php/apache2-php${php_ver}/ext/redis.so ]; then
    bash -c "echo extension=redis.so > /etc/php/apache2-php${php_ver}/ext/redis.ini"
fi
if [ -f /etc/php/apache2-php${php_ver}/ext-active/redis.so ]; then
    cd /etc/php/apache2-php${php_ver}/ext-active/ && ln -s ../ext/redis.so
fi

--------------------------------------------------------------

  1. Mysqldump one table via ssh and gzip
  2. Gentoo statistic script

Страница 11 из 17

  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

Search

Older Posts

  • Greenbone Vulnerability Manager (GVM) hacks (63)
  • elasticsearch cluster red status fix due to high watermark (61)
  • ubuntu arrow keys misbehaviour fix (72)
  • icinga IIS monitoring powershell error Get-WmiObject : Invalid namespace "root\WebAdministration" (84)
  • Make user superadmin in zabbix (81)
  • dnf Error: unknown option (111)
  • unpack pfx certificate (used for apache or nginx) (116)
  • mysql audit plugin build script (290)
  • mysql dump one row (95)
  • redmine 5 docker-compose (199)
  • gitlab runner dind docker-compose (143)
  • AWS S3 IAM policy to limit to single sub folder (146)
  • logrotate hints (197)
  • bash script to clean files to required percentage (322)
  • Ansible create LVM and mount (732)

Login Form

  • Забыли пароль?
  • Забыли логин?
  • Регистрация