Rsync backup with BTRFS

There are plenty of backup tools in the community but I still prefer rsync for desktop backup. It only copies the changes and it does not require any catalog. I’ve been using that for years, rsync-ing my files to a USB drive. While it works fine and it saved my day a couple times, my script only keeps 1 version of backup. It’d be nice if I can have at…

Read More

Skullcandy Crusher Wireless

I am a bass head and I’ve been drawn to bass heavy head phones. I’ve had AKG k550 and Pioneer SE-MHR5 before. Last week my Skullcandy arrived. It differs from all my previous headphones as it features a 40mm dynamic driver and a secondary 35mm haptic driver. If you are thinking about getting one, read on.  I’ll be brief with the physical aspects. Build quality is good and solid. Ear…

Read More

UID > INT_MAX

From thehackernews, it was said when the UID is larger than INT_MAX, which is 2147483647, privilege validation is improperly handled and that gives the user right to run systemctl commands as if he/she is a privileged user. What is my INT_MAX? Though it’s hard to imagine who would use such an UID when they usually starts with 1000. However, if Linux is integrated with AD, the AD users ID are mapped…

Read More

Cool feature on Azure – Run Command Script

I don’t think I’ve ever said anything good about Azure, but I’ve finally ran into one today. Someone screwed up sshd_config and the service would not start anymore. With the run script tool, I was able to revert the config to the original version and restart the service. Fortunately, the changes were checked into RCS, which made recovery relatively easy. Here, I checked out the original version of the config…

Read More

tmux send input to all panes

Run tmux and have it split into 2 panes, each running a separate process, and send input to all panes. Here I start up one container in each pane, then turn on input broadcast. One can easily modify the commands and have tmux gives control over a cluster of servers. Or ssh to different servers and manage them all at once.

This is trememdously useful for myself. To turn…

Read More

Add security group to all ec2 instances

If you ever need to take over management of an AWS farm, it’s very likely you will need to attach SG to all instances. Be that for monitoring or access. Here is a bash script to add 1 SG to all instances. You will need to first setup a profile on awscli. Then run the script with the profile name as first argument, and the SG id as the second.…

Read More

Building my first Linux package

Let’s take a look at how to build a really simple Linux package. The most common package formats are definitely .deb and .rpm. One will find them on Debian-variants and Redhat-variants respectively. In the following examples, a package will be created and it will contain 1 script.The script depends on Python so I want the package management tool to handle that for me too. The script’s name is goldenRatio.sh and…

Read More

php debugging

There are a couple ways to debug php applications. We can enable core dump and/or install Xdebug. Enable php core dump on php-fpm First instruct the kernel to write core dumps to /tmp. On some system, dumps are fed to abrtd.

In php-fpm.conf, add the following

Restart php-fpm and use gdb to debug the dump files. To get the most out of the dump files, install the debuginfo…

Read More

kubernetes quickstart

kubernetes and docker In this post, I’ll be deploying a docker cluster running a number of nginx containers. Bare with me though as I am still learning about kubernetes and docker. Machines The master node will be controlling the worker nodes. Deployments will not run on the master node itself. From my experience, at least 1.5Gi of memory is needed for these machines. k8s-ms | 10.0.0.165 k8s-wk1 | 10.0.0.44 k8s-wk2…

Read More