comment specific line using sed command 1

comment specific line using sed command

Comment specific line using sed command can be used to configuration files …

 

Import large .sql file into MySQL database 2

Import large .sql file into MySQL database

Should be used for really huge database imports like tens of GB … Note: remember to navigate to the directory where your .sql file lives so you can use source on it later …

Note: if you’re not sure what these options do, please, do some research  first.

   

Search inside tarball on Linux 3

Search inside tarball on Linux

Searching inside a tarball file (even gzipped) can be really relieving. You don’t have to extract all the files every time to seek for a file using find command. Search tarball files using grep

Search tarball files using its built-in parameter Note: that if you want to use wildcards you need to add –wildcards […]

Copy multiple files via ssh and preserve permissions and ownership 4

Copy multiple files via ssh and preserve permissions and ownership

Copy multiple files via ssh and preserve permissions and ownership. Creating a tarball on the fly and pipe its output through ssh afterwards extracting the files from the tarball will let us speedup the uploading times because the stream of data is continuous through the network and therefore will be done in one single connection. […]

Symlink scan on Linux web server 5

Symlink scan on Linux web server

Scan symlinks on web server directory structure recursively to find if any symlinks exist. I used it to discover if a shared web hosting server was compromised/ rooted using the symlink attack. Read about the attack in the link below. Note: Don’t forget to change the path.

Anatomy of the attack

PHP Malware Scan on Linux Server 6

PHP Malware Scan on Linux Server

Note: that there will be a lot false positives when scanning WordPress file structures.

 

Find world writable files on a Linux system 7

Find world writable files on a Linux system

Discover world writable files (aka with permission 777) will help you sometimes find out which files you missed to secure from your user’s eyes.

If you don’t understand Linux file permission bits you should read this

Sort first 20 processes by ram usage on linux system 8

Sort first 20 processes by ram usage on linux system

Sorting the first 20 processes by ram in a linux system is often useful when you want to narrow down and find which processes are eating up your server’s RAM

 

Find ulimit -a for other users that don't have shell access 9

Find ulimit -a for other users that don’t have shell access

Find ulimit -a for other users that don’t have shell access using su command and ulimit attaching a bash shell

merge pdf files in linux

How to merge multiple PDF files in Linux

This entry is part 1 of 2 in the series PDF Editing In Linux

Merge multiple PDF files in Linux is easy running one simple command by using PDF Toolkit. Installation on Ubuntu > 16.04:

Merge multiple pdf files: In this example we have n pdf files in the same directory, each file has the prefix sample-pdf-. The command below will merge n number of pdf files, using […]