Jan 5 2018

Resize HDD

The process is quite simple:

a) Connect to the VMware ESXi 5 server using the vShpere Client. Edit the VM’s properties to increase the hard disk size (VM has to be off) – I won’t get into details on that, if you have the experience on managing ESXi you know what to do… I’m assuming the process is the same for ESXi 4. Now restart the VM.

b) Login via SSH to the VM and follow this process.
– First list all partitions:
$ ls -al /dev/sda*

– Create new partition using fdisk:
$ fdisk /dev/sda
Then:
type p – to list all your partitions
type n – to create a new partition
type l – for “logical”
then give it a number (e.g. if you got 2 partitions listed as /dev/sda1 & /dev/sda2, for the new partition simply type “3” to create /dev/sda3)
type t – to change the partition type to “Linux LVM”
provide the partition number you previously created
type 8e – for the “Linux LVM” type
type p – to list the new partition table
type w – to write changes and exit

– Reboot server:
$ reboot

– Assuming you created partition /dev/sda3, let’s now create the physical volume in that partition:
$ pvcreate /dev/sda3
 
– Now let’s extend the server’s Volume Group to that physical volume.
$ vgdisplay
This will give you the info on your current Volume Group. Note down the entry next to “VG Name”. That’s your Volume Group name.
$ vgextend EnterVolumeGroupNameHere /dev/sda3

Keep in mind
If you get a message saying /dev/sda3 could not be added to your Volume Group, you need to remove the physical volume and recreate it. Metadata might have gotten corrupt and thus the volume cannot be added to your Volume Group. So just do:
$ pvremove /dev/sda3
And then again:
$ pvcreate /dev/sda3
 
– Since we’re (essentially) extending the main logical volume, let’s get the name of that:
$ lvdisplay
and note down the entry next to “LV Name”. This is your logical volume’s name (e.g. /dev/srv/root), which you’ll now extend to the newly added partition/physical volume.

– Extend the logical volume by X GBs:
$ lvextend -L +XG yourLogicalVolumeName
Make sure you replace X above with the actual number of GBs you’ve added in your VM’s settings. So if you increased your VM by 20GBs, the command becomes:
$ lvextend -L +20G yourLogicalVolumeName
 
– Finally, let’s resize the file system to the new allocated space:
$ resize2fs yourLogicalVolumeName
(this may take some time depending on number of GBs added to the file system.

– Check the new file system sizes:
$ df -hT
You should now see an increased disk space for your primary logical volume.

– Reboot and you’re set 🙂

https://www.joomlaworks.net/blog/item/168-resizing-the-disk-space-on-ubuntu-server-vms-running-on-vmware-esxi-5


Oct 21 2017

How To Install and Configure Redis

sudo apt-get update

sudo apt-get install build-essential tcl

apt-get install build-essential tcl

curl -O http://download.redis.io/redis-stable.tar.gz

tar xzvf redis-stable.tar.gz

cd redis-stable

make

make test

make install

mkdir /etc/redis

cp  redis.conf /etc/redis

supervised systemd

dir /var/lib/redis

vi  /etc/systemd/system/redis.service

[Unit]
 Description=Redis In-Memory Data Store
 After=network.target

[Service]
 User=redis
 Group=redis
 ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf
 ExecStop=/usr/local/bin/redis-cli shutdown
 Restart=always

[Install]
 WantedBy=multi-user.target

adduser --system --group --no-create-home redis

mkdir /var/lib/redis

chown redis:redis /var/lib/redis

chmod 770 /var/lib/redis

systemctl start redis

systemctl status redis

redis-cli

ping

get test

set test "It's working!"

exit

systemctl restart redis

systemctl enable redis

 


Oct 12 2017

FTP upload

ftp-upload -h ftp.kadalhamil.com -u ftpuser –password kecebongpremium -d BACKUP *.iso &


Oct 12 2017

multi gateway

ifconfig eth0 202.152.18.xxx netmask 255.155.255.224

ifconfig eth1 192.168.46.xxx netmask 255.255.255.0

route add default gw 202.152.18.1

route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.46.1 eth1

 

 


Oct 6 2017

Antara anak tercinta, aku dan HULK… ‘salbud deh’


Oct 6 2017

hak akses untuk folder ‘upload’ pada WP

chown -R kadalsumbing:www-data uploads/

chmod -R 755 upload/


Oct 5 2017

Setting alias di NGINX

rewrite /wp-admin$ $scheme://$host$uri/ permanent;

location ~ ^/files/(.*)$ {
try_files /wp-content/blogs.dir/$uri /wp-includes/ms-files.php?file=$1 ;
}

location ^~ /blogs.dir {
internal;
alias /home/kadal/web/kadalbencong.net/public_html/wp-content/blogs.dir ;
access_log off;
log_not_found off;
expires max;
}


Oct 5 2017

Hello Dunyo…!!!

“…merdeka adalah, selamet nang ndunyo lan nang akherat …”