My use-case is that I have an upload folder which I'd like to reindex when something is uploaded/deleted. For this I watch the file size with du command.
It should be triggered via cron or systemd timer.
Friday, January 10, 2020
Friday, December 27, 2019
Boot Archlinux CD iso from local disk with GRUB
I use btrfs snapshots to backup my system. In order to restore to previous snapshot I had to boot live CD and do the restore. But as live CD is not always at hand, it's better to have an ISO stored locally on your disk and boot directly from it.
I use GRUB2 and archlinux, for which I've created the configuration.
I use GRUB2 and archlinux, for which I've created the configuration.
Friday, December 7, 2018
Install Archlinux on LUKS encrypted BTRFS filesystem with subvolumes
In this post I will go through the system installation. Second post will be about btrfs snapshots, namely how to create and restore snapshot.
ArchLinux installation is very well documented on Archlinux Wiki. My tutorial basically follows all the necessary steps from the wiki page with some additional configuration to achieve:
ArchLinux installation is very well documented on Archlinux Wiki. My tutorial basically follows all the necessary steps from the wiki page with some additional configuration to achieve:
- LUKS encryption (this will be applied to all partitions except /boot)
- btrfs formatted filesystem, with use of subvolumes with flat layout
Thursday, December 6, 2018
VirtualBox: shrink Clonezilla disk image
I've spent some time until I finally found out how you can not only increase the disk image but also how to shrink it.
Use case:
I had an disk backup created with clonezilla. The source disk size was 1TB and the restore disk size was 256GB. The actual data amount was around 120GB, so it would definitely fit on the smaller disk.
But with clonezilla, I wasn't able to restore it.
Use case:
I had an disk backup created with clonezilla. The source disk size was 1TB and the restore disk size was 256GB. The actual data amount was around 120GB, so it would definitely fit on the smaller disk.
But with clonezilla, I wasn't able to restore it.
Friday, March 23, 2018
Bash Functions
This post contains few functions, or tips I often use, so I keep them close.
Elasticsearch: setting up watcher for FS monitoring
In
this post, we'll go through components used for this case scenario and
the process of setting up a watcher within elasticsearch.
Our
case scenario: we have three machines running different OS (all are
linux based) and we'd like to be notified when we're running low on disk
space. For this we've taken advantage of running elasticsearch instance
with Gold license and enabled watcher feature.
Wednesday, November 15, 2017
SF OS X
Android. That's the operating system which most probably runs on your mobile phone.
While this is the very common system to have nowadays, it's matured enough throughout the years and built very rich ecosystem of applications, there are a few things which I don't like on it.
The basic idea is, that if you buy something, you should own it. You should be able to disassemble it and modify it, to adjust it to your needs and most noticeably: you should be in full control of your device.
While this is the very common system to have nowadays, it's matured enough throughout the years and built very rich ecosystem of applications, there are a few things which I don't like on it.
The basic idea is, that if you buy something, you should own it. You should be able to disassemble it and modify it, to adjust it to your needs and most noticeably: you should be in full control of your device.
Hide Tab Bar in Firefox 57+
Finally I've found a way to hide tabs from Firefox.
I use Tree Style Tabs addons and don't need native tabs.
So here is how you can do it:
I use Tree Style Tabs addons and don't need native tabs.
So here is how you can do it:
Saturday, July 30, 2016
Ping-based Host Monitoring Script with Timestamps
In my previous post Server availability monitoring with email notifications I've used the same idea of monitoring. This script is a version 2.0 with some additional features:
- If you compare old and new version, you'll notice the script was completely rewritten. It's because I wanted it to run on my synology NAS.
- Next change is additional host states, instead of A-available and N-notAvailable I'm now using 2 additional states Going Up, Going Down. This will delay the notification about host state change and prevent frequent flapping of naughty hosts in network.
- Last feature added is hosts UP/DOWN times in notifications; see mail notification example:
Wednesday, June 22, 2016
SSH Two Factor Authentication for RaspberryPi
Another cool feature for your remote ssh connection - 2-factor authentication or 2-step verification. It helps to improve security for remote access to your machine and it is pretty simple to setup, you can get it up and running in just a few minutes...
Tuesday, June 21, 2016
autofs: automount nfs share
This small tool is designed to mount various types of filesystems, not only NFS shares. It watches for when you try to access defined mount point and auto-mount it right away. Then after specified timeout, it will unmount them.
Advantage: if you have many NFS clients, you may want to reduce active connections to the server and improve overall performance of the server. Or perhaps you are too lazy to mount NFS, as I am and just give it to the hands of autofs (:
Advantage: if you have many NFS clients, you may want to reduce active connections to the server and improve overall performance of the server. Or perhaps you are too lazy to mount NFS, as I am and just give it to the hands of autofs (:
Wednesday, June 15, 2016
LUKS Containers
This post demostrates how to create LUKS encrypted container. Basically I followed these steps to create and mount such a container.
To sum up for TLDR persons (: here are the few basic steps you have to follow:
To sum up for TLDR persons (: here are the few basic steps you have to follow:
Clonezilla: Boot from EFI
In this post, I show how to boot clonezilla (iso) from EFI bootloader (Clover) or from USB key with syslinux. You may be familiar with my previous post Boot iso image from GRUB2 or Clonezilla UEFI boot.
This time I have slightly different use case:
This time I have slightly different use case:
- I have working EFI partition with Clover BootLoader on my laptop
- I needed to add Clonezilla to Clover menu, to be able to boot from my HDD
Thursday, June 2, 2016
XFCE: some KDE icons are not shown
I've noticed that some icons in KDE Applications are not shown, or replaced by other icons from default gnome set. Solution should be to change icons in the XFCE setting, but if it doesn't work, you can try setting them with gconftool:
gconftool-2 --type boolean --set /desktop/gnome/interface/buttons_have_icons true gconftool-2 --type boolean --set /desktop/gnome/interface/menus_have_icons true
Making Palemoon your default Browser
Weather you are using some weird DE/WM combination, or setting Palemoon as default browser simply does not work, you can try to create following files, to set it up...
Wednesday, November 25, 2015
Source management tool
Recently I got Linux From Scratch book in my hands and I've built my own distribution. It was a great experience and I've learned a lot about core Linux system. Either way one simple question came to my mind: how can I manage all those packages from source archives?
This topic is mentioned in the book where a few methods are briefly described. Based on this knowledge, I've created a simple package manager.
This topic is mentioned in the book where a few methods are briefly described. Based on this knowledge, I've created a simple package manager.
Creating a self-signed certificate with own CA
This post is a short howto for creating own certification authority (CA) and generating and signing certificate with this CA.
Sunday, May 3, 2015
Clonezilla UEFI boot
Clonezilla is awesome tool to backup your data. It has also released images able to boot from UEFI loader. This post shows how to create bootable USB from iso.
Friday, May 1, 2015
Howto: join mp4 files
To join two or more mp4 video files you can use ffmpeg utility, just follow this simple steps:
- convert mp4 to ts (transport stream) format
- join several ts files into one mp4
ffmpeg -i file.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts file1.ts
ffmpeg -i "concat:file1.ts|file2.ts" -c copy -bsf:a aac_adtstoasc file12.mp4
- conversion from other formats to mp4
ffmpeg -i fileOLD.webm -strict -2 fileNEW.mp4
Tuesday, January 27, 2015
Dynamic shell prompt
Dynamic shell prompt can change it's form according to some events going on on terminal. It can change e.g. color, if the previous command execution was unsuccessful, or it can display various information.
In this post, there is an example of such a prompt. It displays information, when you enter specified working directory.
The picture below shows my configuration:
This is achieved with setting a variable PROMPT_COMMAND which is evaluated every time you run a command. In my case, there is a condition, which looks for matching path.
In this post, there is an example of such a prompt. It displays information, when you enter specified working directory.
The picture below shows my configuration:
This is achieved with setting a variable PROMPT_COMMAND which is evaluated every time you run a command. In my case, there is a condition, which looks for matching path.
# dynamic PS prompt export PROMPT_COMMAND='PS1="$(if [ "$(pwd | grep /mnt/storage/backup_git)" ]; then echo "\\[\\033[32m\\]backup_git "; fi;)\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] "'
Subscribe to:
Posts (Atom)