Convert linefeeds for all files in a folder (CRLF to LF)
If you are working in teams using different operating systems, it could happen, that you get files with unsuitable linefeeds in it. For me as a Linux user the bad guys are normally CRLF’s (Carriage Return and Line Feed @see https://en.wikipedia.org/wiki/Newline). To just convert the CRLF’s in a single file to LF you can use the […]
Shrink PDF
For some applications it is necessary to keep the file size of an PDF under a certain limit. For example for document uploads on some websites or to maintain the attachment file size limit of some email server. You can use the following shell script to have a schrink command (Source: https://dev.to/manishfoodtechs/shrinking-file-size-of-pdf-using-a-small-bash-script-2pd1). Usage Webservice to shrink […]
Disallow crawling in robots.txt
Disallow all User-agent: * Disallow: / Comments # Comments appear after the “#” symbol at the start of a line, # or after a directive User-agent: * # match all bots Disallow: / # keep them out
European union country codes
ISO-3166-1 alpha-2: BE BG CZ DK DE EE IE EL ES FR HR IT CY LV LT LU HU MT NL AT PL PT RO SI SK FI SE UK
SFTP connection via keyfile
You can connect to an SFTPÂ server via keyfile like that: $> sftp -v -o IdentityFile=”/PATH/TO/PUBLICKEYFILE(id_rsa)” -o Port=”10022″ user@host
Lock shellscript process under Unix based systems
Today I ran again into a common problem when dealing with cron based scipts that run concurrently. That’s why I had to lock shellscript process until it is finished before starting the next executing round. On Unix based systems like Linux you can achieve that with flock. flock binds a file descriptor to a certain lock […]
Rename files to upper or lower case
To Rename file to upper case or lower case (* == file selector): Convert to lower case file names Convert to upper case
VmWare VDI to VMDK
Multiselect Options Text
To render the text-values of an multiselect in a BE-grid: <?php /** * * Magento * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * It is available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * * * @category AskSheldon * @package AskSheldon_Adminhtml * […]