Archive for the ‘Unix’ 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, […]

Comcast IPv6 on M0n0wall

by Jason Stewart
System > General Setup > Enable IPv6 Support Interfaces > WAN > IPv6 Configuration > IPv6 Mode: DHCP Interfaces > LAN > IPv6 Mode: DHCP-PD (DHCP Prefix Delegation) Interfaces > LAN > IPv6 Prefix Delegation: 1 / 64 Interfaces > LAN > IPv6 RA: Send IPv6 router advertisements, Flags = “Managed” Firewall > IPv6 Rules […]

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/ on line 14