Archive for the ‘Linux’ Category

Writing Win32 Applications with MinGW and Wine

by Jason Stewart
Use Cygwin to install your favorite unix userland tools under Microsoft Windows. Be sure to include the following packages: make gdb mingw64-i686-binutils mingw64-i686-gcc-core mingw64-i686-gcc-g++ mingw64-i686-headers mingw64-i686-runtime mingw64-i686-runtime-debuginfo w32api-headers w32api-runtime w32api-headers-debuginfo Building Under Linux (Debian / Ubuntu) To build under Debian-based distributions like Ubuntu or Mint, install the following: NOTE: I’m typically writing 32-bit windows applications. […]

Debugging cron Scripts

by Jason Stewart
People come up with all sorts of debatable shell voodoo for debugging an errant cron job. If the script runs successfully under your interactive shell, yet fails under cron, I am 99% sure for your case (and 100% sure for my case) that it is due to a difference in runtime environments. For simple scripts, […]

Dynamic MOTD in Debian and Ubuntu

by Jason Stewart
The Helpers figlet and lolcat come in handy when you’re pimping your console, so let’s go ahead and install them: sudo apt-get install figlet lolcat We may also need an assist from strace, so: sudo apt-get install strace PAM Ubuntu first implemented dynamic MOTD with scripts, then PAM adopted the same approach internally. For this […]

Installing djbdns on Debian 8 “Jessie”

by Jason Stewart
DNS done right!

Faster Samba (SMB / CIFS) Share Performance

by Jason Stewart
Is your Samba slow? Samba file sharing is great, but performance under Samba’s default configuration is fairly poor. Here are a few options that I add to my smb.conf to get the speed that I need: [global] # FORCE THE DISK SYSTEM TO ALLOCATE REAL STORAGE BLOCKS WHEN # A FILE IS CREATED OR EXTENDED […]

DNS Hostname Resolution Fails, DIG and NSLOOKUP Succeed

by Jason Stewart
If you have ever encountered the situation where name-based resolution fails, yet a check against dig or nslookup succeeds for the same hostname, you may be experiencing a conflict with Multicast DNS (mDNS) name resolution. On February 20, 2013, IETF published and approved RFC 6762 which reserves .local as a fake TLD for hostnames that […]

Recursively chmod Files or Folders Only

by Jason Stewart
Ever need to recursively set permissions only on files or folders in Linux/Unix? One way to do it is with the find command. For files, use -type f.  For directories, use -type d. For example: # RECURSIVELY CHMOD DIRECTORIES UNDER CURRENT PATH TO 750 find ./ -type d -exec chmod 750 {} \; # RECURSIVELY […]

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/eggplant.pro/site/blog/wp-content/themes/eggplant2/inc/nav.php on line 14