2

minikube wrapper – kubernetes

What is minikube? Minikube was developed to allow users to run Kubernetes LOCALLY. When you run minikube it will launch a minikube host as a container/VM depending on the driver and runs a single-node k8s cluster. Why minikube? Previously whenever I needed to test anything in the kubernetes environment I would stand up a full suite of servers 4 actually, 3 workers and 1 master node on a VM and it was very time-consuming to set up and use and also resource-intensive for my tiny home lab. I needed a way to create an environment fast and make it re-producible… Continue Reading

0

use fail2ban to block wordpress login attempts

Today while monitoring traffic on my server I noticed that there was 1 IP from UK that is keep accessing my server and generating noticeable amount of traffic. I did a quick IP lookup and netstat to find that the IP was accessing port 80 on my server. I then went to the httpd logs and searched for the IP and wala! it is trying to log into my wordpress site attempt after attempt. Since I already have fail2ban running on my server I decided to look into using fail2ban to ban lots of failed attempts looking at my logs… Continue Reading

0

Colourful ! systemd vs sysVinit Linux Cheatsheet

systemd is the new init system, started with Fedora and now started adopted in many distributions like redhat, suse and centos. This long period we all been using traditional SysV init scripts usually residing in /etc/rc.d/init.d/ directory. These scripts invokes daemon binary which will then forks a background process. Even though shell scripts very are flexible buts other tasks like supervising processes and parallized execution ordering will be very hard to implement. With the introduction of systemd new-style daemons which makes easier to supervise and control them at runtime and simplifies their implementation. systemctl command is a very good initiative… Continue Reading

0

mount qcow2 with libguestfs

sometimes you have multiple qcow2 files sitting around from older upgrades and OS’s that you just need to grab a file or a config from and dont want to bother with booting it up. there is a way to mount the filesystem using libguestfs which can save time! This works with LVM and non LVM qcow2 files and also even if you dont know how the qcow2 partitions are laid out you can feed it a bogus partition and it will list it for you. # guestmount -a rhel5.qcow2 -m /dev/sdzz1 /mnt libguestfs: error: mount_options: mount_options_stub: /dev/sdzz1: No such file… Continue Reading

0

mysql changing to utf8 and converting DB to utf8

by default mysql is installed as latin1 and sometimes it causes problems when your data is not always latin1. Follow the steps to change mysql to utf and also convert existing databases to UTF8 #1 backup your databases and convert it to UTF8 mysqldump -uusername -ppassword -c -e –default-character-set=utf8 –single-transaction –skip-set-charset –add-drop-database -B dbname -r dbname.utf8.dump.sql do this for each of your databases. #2 shutdown mysql service mysqld stop #3 edit /etc/my.cnf ADD to [mysqld] section # init_connect=’SET collation_connection = utf8_unicode_ci’ init_connect=’SET NAMES utf8′ character-set-server=utf8 collation-server=utf8_unicode_ci skip-character-set-client-handshake also [client] default-character-set=utf8 #4 restart mysqld service mysqld start #5 import your databases… Continue Reading

0

wget stuff

Many times when downloading via command line large files you might want to run it in the background and forget about it. you can run this is screen however its also good to use wget options. one quicky is to do wget -bqc url -b is to background as soon as starting -c is to resume broken downloads -q is to quiet wget

0

VirtualBox – how to create and share disks to setup/test clusters

Once in a while you will want to setup clusters with shared disks to test and play around with various clusters. while this is easy to do in kvm/xen/etc its not so easy with virtualbox. There is a way via command line tools to create disks and attaching it so that it is shared. For me I have windows 7 64bit and I am running virtualbox 64bit 4.xxxxx. It is most likely easier if you include the path for “c:Program FilesOracleVirtualBox” however if you do not its ok. We will need to run the command VBoxManage or “c:Program FilesOracleVirtualBoxVBoxManage.exe” if… Continue Reading

0

How to rollback YUM UPDATES

Once in a while you might have problems after running “yum update.” There is an intermediate solution by rollback feature included in YUM. THIS OPTION IS NOT ENABLED BY DEFAULT. 1. To enable rollback edit /etc/yum.conf and add tsflags=repackage 2. Add the following line into /etc/rpm/macros file if it doesn’t exist and add %_repackage_all_erasures 1 now you are all set and can use the following examples to rollback rpm -Uvh –rollback ’22:00′ rpm -Uvh –rollback ‘3 hours ago’ rpm -Uvh –rollback ‘june 13’ rpm -Uvh –rollback ‘yesterday’ All previous repackaged software will be stored onto /var/spool/repackage

0

whose using my ports ?

When troubleshooting applications you will sometimes need to find out what process is using your ports so that you can isolate it or kill it or readjust it so that it will work better with other applications on the same server. lsof is always the best method to see what is running on various ports however there is also an alternative. lets do lsof first lets say you want to find out what is running on port 8400 since it states that the port is open via netstat netstat -an | grep 8400 tcp 0 0 0.0.0.0:8400 0.0.0.0:* LISTEN so… Continue Reading

0

Dell OMSA 101 – mirroring and bootstraping

If you have a environment that has a lot of dell servers and want to get storage and chassis information OMSA is the way to do it. If your machines have access to the internet you can easily download it from linux.dell.com and install it however if you have a good number of servers and/or do not have access to the internet via your servers you will most likely want to mirror the repository so that you can install it from your trusted host. In this post we will assume that we have a trusted host that has access to… Continue Reading