Sed – Deleting Multiline Patterns

Published on Author gryzli

Here is an easy way to delete multiline patterns with sed.   Let say we have the following pattern:  

  Now consider we want to delete the BEGIN/END block,  containing “ID:45”:

  And here is some explanation of the command run above:

 

Installing perlbrew on Centos/Rhel/Fedora

Published on Author gryzliLeave a comment
Installing perlbrew

Why you may need perlbrew ? Perlbrew gives you the ability to maintain multiple perl versions, each having different set of install perl modules. The concept is not any new, we have already seen such things in Python (virtualenv) or Ruby (rvm). Basically you get the following benefits (as state in the perlbrew site also):… Continue reading Installing perlbrew on Centos/Rhel/Fedora

Centos/RHEL/Fedora Create Your Own YUM Repository

Published on Author gryzliLeave a comment

If you have learned how to build your own rpm packages (or want to use custom already built ones) , you maybe want to use your own yum repository for installing these packages. In the following how-to I will show you how to easily setup a yum repository. Prerequisites 1| Install createrepo First you need… Continue reading Centos/RHEL/Fedora Create Your Own YUM Repository

Centos/RHEL/Fedora Build RPM Package From Scratch

Published on Author gryzliLeave a comment
Build custom RPM on centos/rhel/fedora

Why to create your own RPM Package ? In the following post, I will explain how one could easily build RPM package from a custom files. Let say you have added some custom scripts or files and you want to create RPM of them, here is how to do it.   How to build your own… Continue reading Centos/RHEL/Fedora Build RPM Package From Scratch

YUM – List all avialable packages from a given repository – Fedora/Centos/Rhel

Published on Author gryzliLeave a comment

1. Get the repository ID This is sample repolist on Centos/RHEL 7.X

  The repo ID for Atomic repo is: “atomic“ This is sample repolist on Centos/RHEL 6.X

  The repo ID for Webmin is: “Webmin”    2. List all available packages from a given repository List all packages for repo: Webmin

Continue reading YUM – List all avialable packages from a given repository – Fedora/Centos/Rhel

Linux ImageMagick (convert) some basic stuff

Published on Author gryzliLeave a comment

ImageMagick (convert) tool could be used for different image manipulation tasks. Here I will mention some of them I have used it for. Get verbose information about image # convert some_test_image.jpg -verbose info:   Change JPEG image quality # convert original_image.jpg -quality 50 new_image_with_50_quality.jpg   Convert/Resize image to 1600×1600 to fit ebay requirements I need this conversion in order… Continue reading Linux ImageMagick (convert) some basic stuff

lftp – Rsync over FTP alternative

Published on Author gryzliLeave a comment

This is very useful software, which can be used for “mirroring” data through FTP. Under Centos 6.x, the package is called: lftp , and is available through standard package repo. Here are some usage examples;   1. Mirror Destination FTP directory –> To local directory

  2. Mirror  Local directory  –> To destination FTP directory… Continue reading lftp – Rsync over FTP alternative

Mounting remote filesystem through SSH/SCP by using SSHFS

Published on Author gryzliLeave a comment

Background Recently I found myself frequently editing files locally (with some nice IDE/ text editor) and then having to re-upload them to a destination server. And…. one day I searched for “SSH filesystem” through Google, which was so kind to return me the following result: https://www.digitalocean.com/community/tutorials/how-to-use-sshfs-to-mount-remote-file-systems-over-ssh This was my first touch to sshfs, which seemed… Continue reading Mounting remote filesystem through SSH/SCP by using SSHFS

Nmap – Port scanning

Published on Author gryzli

Here I will post some basic examples: 1. Scan all hosts in a given network for specific open port – This will scan network 192.168.0.1 /24 for open port 10000 (which belongs to WebMin)

2. Scan all ports on given host