Here are two unbelievable sources for just about anything imaginable:
https://www.alibaba.com
https://www.ec21.com
The breadth and depth of available products is simply breathtaking.
For example:
a rather disconcerting network management device
tiny Geode pc (like Soekris?)
or just cute pc
With the speed this stuff moves, I don’t expect the above links to last long! š
From Cliff Pearson’s excellent system administration blog:
<<begin quote>>
From time to time, people want me to create LINUX init scripts for them. I usually just take an existing one for another service and change it up to work for my new application, but most of them have become so long these days that I end up having to hack out a ton of code just to reduce them down to the very basic script I need. I decided to create this very simple template so I wouldnāt have to keep trimming down the more complex scripts that one tends to find in /etc/init.d
these days.
This script is chkconfig compatible, so call it the name of your new service and put it in /etc/init.d
The chkconfig: 235
section indicates the the default runlevels. For instance, if we called this script /etc/init.d/new-service
and ran chkconfig new-service on
, it would be active in runlevels 2,3 and 5.
The 98
and 55
numbers indicate the order of startup and kill. This means that using this tag, the startup symbolic link would be named S98new-service
and the symbolic link to kill the process would be named K55new-service
.
#### SNIP ####
#! /bin/sh
# Basic support for IRIX style chkconfig
###
# chkconfig: 235 98 55
# description: Manages the services you are controlling with the chkconfig command
###
case "$1" in
start)
echo -n "Starting new-service"
#To run it as root:
/path/to/command/to/start/new-service
#Or to run it as some other user:
/bin/su - username -c /path/to/command/to/start/new-service
echo "."
;;
stop)
echo -n "Stopping new-service"
#To run it as root:
/path/to/command/to/stop/new-service
#Or to run it as some other user:
/bin/su - username -c /path/to/command/to/stop/new-service
echo "."
;;
*)
echo "Usage: /sbin/service new-service {start|stop}"
exit 1
esac
exit 0
#### /SNIP ####
Obviously change all instances of ānew-serviceā to the name of your actual service⦠Enjoy!
<< end quote >>
I don’t know how much difference it makes but since I use Ruby 1.8.6 under Ubuntu for development, I prefer to use the same version in production on Centos. Unfortunately, CentOS-5.1 still comes with version 1.8.5.
Fortunately, someone has kindly gone to the trouble of building CentOS-5.1 rpms.
From centos.org:
Jacek (wolk at jablko.one.pl) rebuilt a few ruby-1.8..6 rpms from fedora under Centos 5.1. His yum repo is avilable at: https://repo.premiumhelp.eu/ruby/
To use with yum, create /etc/yum.repos.d/ruby.repo and add the following:
[ruby]
name=ruby
baseurl=https://repo.premiumhelp.eu/ruby/
gpgcheck=0
enabled=0
————————————————————————–
Sample usage:
#yum –enablerepo=ruby list *RUBY*
Thanks to Jacek
While the WordPress export funtion is better than nothing, the proper way to backup your WP site is to dump the underlying SQL database. Instructions on how to do this are here.
This was a time waster: I had a simple dialog-based application which happened to include a RichEdit control. But every time the program launched, the wizard created Run function printed “Main dialog creation failed!” and stopped. Everything would work fine until I added a RichEdit control.
Finally I found that adding the following to my _tWinMain resolved the issue:
HINSTANCE hInstRich = ::LoadLibrary(CRichEditCtrl::GetLibraryName());
Unfortunately I forgot that Rich Edit isn’t a common control and is not initialized with InitCommonControlsEx. As far as I know, this is the only control supported in the VS dialog editor that needs its own LoadLibrary.
Ever wanted to add Gnome (or anything else) after installing a text-mode Centos? Here’s how:
Get a list of available package groups:
# yum grouplist
Loading "installonlyn" plugin
Setting up Group Process
Setting up repositories
Installed Groups:
Editors
System Tools
...
Available Groups:
Office/Productivity
GNOME Software Development
GNOME Desktop Environment
KDE Software Development
KDE (K Desktop Environment)
Server Configuration Tools
Administration Tools
...
Done
#
So to install Gnome:
yum install "GNOME Desktop Environment"
And go get a coffee.
Ever run into:
Error 3 fatal error C1083: Cannot open include file: 'sddl.h': No such file or directory C:Program FilesMicrosoft Visual Studio 9.0VCceatlmfcincludeatlsecurity.h
And of course you never included atlsecutity.h in your project so who knows which file did…
Add /showincludes to your cl options and all becomes clear. BTW, gcc has an infinitely better system for reporting nested file issues – wonder how long before MS figures it out.
While playing with Boost I recently ran into a bunch of library mismatch errors. Knowing which files do what helps immensely and, while I’m using VS 2008, the best summary I found was from an MSDN article on Microsoft Visual C++ 4.2.
Library types and related compiler switches |
Basic C runtime library |
Standard C++ Library |
Old iostream library |
Single Threaded (ML) |
LIBC.LIB |
LIBCP.LIB |
LIBCI.LIB |
Multithreaded (MT) |
LIBCMT.LIB |
LIBCPMT.LIB |
LIBCIMT.LIB |
Multithreaded DLL version (MD) |
MSVCRT.LIB (import library for MSVCRT.DLL) |
MSVCPRT.LIB* (also uses MSVCRT.DLL) |
MSVCIRT.LIB (import library for MSVCIRT.DLL) |
Debug Single Threaded (MLd) |
LIBCD.LIB |
LIBCPD.LIB |
LIBCID.LIB |
Debug Multithreaded (MTd) |
LIBCMTD.LIB |
LIBCPMTD.LIB |
LIBCIMTD.LIB |
Debug Multithreaded DLL (MDd) |
MSVCRTD.LIB (import library for MSVCRTD.DLL) |
MSVCPRTD.LIB * (also uses MSVCRTD.DLL) |
MSVCIRTD.LIB (import library for MSVCIRTD.DLL) |
MSVCPRT.LIB and MSVCPRTD.LIB are static libraries and do not have any DLLs related with them directly. These libraries are also dependent on MSVCRT.DLL and MSVCRTD.DLL, respectively. Any applications that use MSVCPRT.LIB or MSVCPRTD.LIB and use the “Ignore Default Library” (/NOD or NODEFAULTLIB) option, must link MSVCPRT.LIB(or MSVCPRTD.LIB) and MSVCRT.LIB (or MSVCRTD.LIB ), otherwise linker errors (such as LNK2001: unresolved externals in MSVCPRT.LIB or MSVCPRTD.LIB) will be produced.
Lately I’ve been migrating lots of code developed with earlier versions of Visual Studio to the latest, 2008. One situation that keeps arising, now that MSVC is more standards compliant, is the requirement to use typename when defining and using templates.
Error messages can be somewhat misleading:
Error 6 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:...myapp.h 59 myapp
when the compiler sees:
static instances_list::size_type size(void) { return s_instances.size();}
easily fixed as:
static typename instances_list::size_type size(void) { return s_instances.size(); }
From the Visual Studio docs:
“This keyword must be used if the name is a qualified name dependent on a template argument; it is optional if the qualified name is not dependent. For more information, see Templates and Name Resolution. ”
I expect typename was introduced to simplify compiler implementation and, while this worked in earlier versions of MSVC, this was likely due to Microsoft’s engineers putting in a lot of hard work.
Last week I was asked how I might implement a Boggle solver. After a bit of thought, I hacked a version in Ruby, then ported it to Windows using C++ and WTL. The zip includes source for the C++ and Ruby versions, as well as a prebuilt Windows binary and a substantial word list from YAWL. Launch from the folder containing the word.list.
By the way, neither implementation handles ‘Q’ yet.
Download Boggle Solver Executable and Source
Recent Comments