Ubuntu 10.04 – Enable core dumps
By default, core dumps are disabled in Ubuntu. To enable core dumps, for the current user, and for the root user:
- gedit /etc/security/limits.conf
- Enable the lines:
* soft core 2000000
root soft core 2000000 - Reboot.
- Use the command ulimits -c to verify that the maximum core dump size has been adjusted.
(Optional) For security reasons, Ubuntu separately enables core dumps for setuid applications:
- gedit /etc/sysctl.conf
- Add the line:
fs.suid_dumpable = 1 - sysctl -p
(Optional) To re-direct and rename core files use a core pattern:
- gedit /etc/sysctl.conf
- Add the lines:
kernel.core_pattern = /var/crash/core.%e.%u.%t
kernel.core_uses_pid = 1 - sysctl -p
References:
- https://bugs.launchpad.net/ubuntu/+source/pam/+bug/65244
- Man page for limits.conf: http://linux.die.net/man/5/limits.conf
- Man page for suid_dumpable: http://man.he.net/man5/proc
- Man page for kernel.core_pattern: https://www.kernel.org/doc/man-pages/online/pages/man5/core.5.html
- http://serverfault.com/questions/173981/no-coredumps-for-daemons-started-at-boot-by-init-d-on-ubuntu
- https://wiki.ubuntu.com/Apport
Windows: Removing a Plug and Play driver from the driver store.
When an OEM kernel driver is installed in Windows, driver files are typically installed to the following locations:
- \Windows\inf\ – the .inf file is renamed to oem#.inf
- \Windows\System32\drivers\
To remove a particular .inf file and related files, see the following article:
On Vista and later, the driver is also added to the Windows Driver Store located in:
- \Windows\System32\DriverStore
The oem.inf filename for a particular driver can be found by enumerating all of the OEM drivers in the Driver Store.
To enumerate the plug-and-play drivers, from a Windows cmd prompt opened in administrator mode, run:
- pnputil.exe –e
To remove a particular OEM driver from the driver store use:
- pnputil.exe -d oem#.inf
Reference:
Link: Optimizing software in C++
A set of articles related to software optimization:
http://www.agner.org/optimize/
Particularly relevant is the article on C++ optimization:
http://www.agner.org/optimize/optimizing_cpp.pdf
These links were recently highlighted in Microsoft’s MSDN enews. Interestingly enough, for obvious reasons, the C++ optimization article is pretty clear in recommending that you avoid .NET and Java for anything requiring performance.
Six phases of a big project
This one has been around for generations, it still makes me smile. A good Project Manager is definitely needed to keep expectations realistic and to keep the project moving productively.
The six phases of a big project:
1. Enthusiasm,
2. Disillusionment,
3. Panic and hysteria,
4. Search for the guilty,
5. Punishment of the innocent, and
6. Praise and honor for the nonparticipants.
Reference:
Windows: Importing a certificate for a service
Windows has several different certificate stores. Using certmgr.msc allows a certificate to be installed for the current user.
However; to make a certificate available to services and other process that run under the Local System or Local Service accounts, you must import the certificate into the the Local Computer store.
To import the certificate, set up a connection the the local computer’s certificate store:
1. Start -> Run: mmc.exe
2. Menu: File -> Add/Remove Snap-in…
3. Under Available snap-ins, select Certificates and press Add>.
4. Select Computer Account for the certificates to manage. Press Next.
5. Select Local Computer and press Finish.
6. Press OK to return to the management console.
Then, import the certificate:
1. Select: Console Root -> Certificates (Local Computer)
2. Continue and select: Trusted Root Certification Authorities -> Certificates.
3. Right click on Certificates and select All Tasks -> Import…
4. Follow the import wizard and import your certificate normally.
References:
Debian: Building a Linux Kernel from Git
Building within Debian; steps for building a custom kernel directly from Linus’ Git repository.
Requires
- Git: apt-get install git
- Compiler and build tools: apt-get install build-essential
- ncurses library for menuconfig: apt-get install libncurses5-dev
Download the Kernel Source
Download the linux git repository to your ~/linux-2.6.git directory.
cd ~
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git linux-2.6.git
cd linux-2.6.git
Check out a particular kernel version
To list the available kernel version tags:
git tag
Check-out a particular kernel version to compile:
git checkout -b AcerAspire_v2.6.35 v2.6.35
Configure the Kernel
Select the desired kernel options:
make menuconfig
The resulting config file is saved to .config.
Note: Unless you know your hardware very well, creating a .config file from scratch is a very daunting task. It is much better to start with an existing .config file from your existing kernel version source package or from another platform that is as close as possible to your desired configuration.
Save a copy of the config file in your repository so that you don’t lose it:
cp .config AcerAspire.config
git add AcerAspire.config
git commit -m “Save custom kernel config file.”
Compile the kernel for use with Debian:
make clean
make KDEB_PKGVERSION=custom.1.0 deb-pkg
Install the kernel
cd ..
ls -al *.deb
dpkg -i linux-image-2.6.35*.deb
update-grub
Reboot to try the new kernel.
Clean up:
Clean out build files:
make clean
Clean out all generated files including the .config file:
make distclean
References:
Firefox Settings
Plugins
- Adblock Plus
- NoScript
- HTTPS-Everywhere
Caching
Type about:cache into the Firefox address bar to view a cache summary.
Edit cache settings:
- Menu: Edit->Preferences or Menu: Tools->Options…
- Button: Advanced
- Tab: Network
- Adjust Offline Storage setting.
Internal Settings
Typing about:config in the Firefox address bar to view and edit internal settings.
- network.prefetch-next – set to false to disable pre-fetching of pages.
References:
Windows – Software List
Depending on the task, here is a partial list of software that I consider for a rebuild on Windows. (*) indicates frequently used items. The list will change as time goes on and as my preferences change.
Utilities:
- (*) 7-zip (Open Source) – File compression utility. Don’t need anything else.
- ISO Recorder (Free/Closed Source) – Image existing CD’s and DVD’s. Copy .iso’s to new disks. It’s surprising that this functionality isn’t built natively into Windows.
- TeraTerm (Open Source) – Terminal program. Replaces Hyperterminal and Procomm. Used for SSH and old serial port stuff.
Editors:
- (*) Notepad++ (Open Source) – Excellent text editor with Syntatic highlighting.
- XML Notepad (Open Source) – XML editor and viewer.
Graphics:
- Paint.Net (Open Source) – Paint and photo editing.
System:
- (*) SysInternals (Free/Closed Source) – Excellent set of tools for watching system calls, monitoring processes, walking Active Directory, etc. Can’t live without Process Explorer and Process Monitor.
Networking:
- (*) Wireshark (Open Source) – Network captures and analysis.
Programming:
- (*) Application Verifier (Free/Closed Source) – Essential for catching exceptions and memory problems. Run it all the time.
- Pencil Project (Open Source) – Rapid Dialog and Screen Prototyping.
- (*) Doxygen (Open Source) – Auto document generation.
- (*) Jenkins (Open Source) – Web based build machine and build farm server.
- (*) WinMerge (Open Source) – Diff and Merge tool.
- Dependency Walker (Free/Closed Source) – Viewer for executable and .DLL dependencies.
- Redmine (Open Source) – Bug tracking and project maintenance for a small project.
- JIRA (Commercial/Open Source) – Bug tracking and project management.
- WinDbg (Free/Closed Source) – Windows debugger. The last word in debugging, when Visual Studio can’t hack it. Its interface is rough, but for driver debugging and 64-bit crash dump analysis, it’s all we’ve got.
- (*) Visual Studio (Commercial) – Absolutely the best IDE on Windows for C/C++. Debugging is light years ahead of everything else. Eclipse and others don’t even come close.
- Mercurial (Open Source) – Distributed source control.
Web Clients:
- (*) Thunderbird (Open Source) – E-mail client. Beats Outlook for junk mail filtering.
- (*) Firefox (Open Source) – Web browser. The NoScript plugin is highly recommended.
Backups:
- (*) Acronis TrueImage (Commercial) – Can’t live without it. Have performed full system restores 3 times now and it has saved my bacon each time.
Antivirus:
- (*) Microsoft Security Essentials (Commercial) – Antivirus from Microsoft. Free for home use. Way better than Symantec and McAfee. Avast and AVG are okay in my opinion.
Windows: Internet Explorer fails to print with preview.js errors.
Symptoms: Attempting to print from Internet Explorer returns the error:
An error has occurred in the script on this page.
Line: 1507 (or whatever)
…
URL: res://ieframe.dll/preview.js
See attached screen shot:
Other symptoms include, missing menu items, or menu items that don’t do anything when selected.
Cause: Some other application wrote to the wrong location or un-registered .dll’s that it wasn’t supposed to during install or uninstall. Which application? Who knows.
Fix: As described in the references below, you’ll have to re-register the IE libraries and components. But first:
- Ensure that your printer actually works. Print a test page from Notepad, or Word or whatever. Printer not working? The rest of these steps won’t help you. Fix your printer.
- Reset IE to ensure that other add-ons aren’t causing you grief.
- Start Internet Explorer
- Press the ALT key to bring up the menu.
- From the menu select: Tools -> Internet Options (this is reachable from the Windows control panel as well)
- Tab: Advanced
- Press the button: Reset…
- Press the button: Reset
- Restart IE
- Attempt to print from IE. Does printing work now? If yes, you’re done. If not, continue.
- Re-register your IE libraries. In the references below, you can do it the Microsoft way and make your own script or use the ready made script from iefaq. I used the ready made script after reviewing it.
- From iefaq listed in the references section, download the script that matches your machine type. I’m running Windows 7 32-bit so I downloaded ie8-rereg.zip.
- Start the Windows File Explorer. Start -> All Programs -> Accessories -> Windows Explorer
- Find the file that you downloaded. Computer -> Your disk (C:) -> Temp (or wherever you downloaded the files to.)
- Right click on the .zip file you downloaded and select Extract…
- Extract the files somewhere reasonable. Example: c:\temp\ie_fix\
- Find the extracted files. Navigate down the directories until you find the .cmd file. In my case the file I wanted was ie-rereg.cmd
- (Optional) Open the .cmd file in Notepad to see what it’s going to do. We’re all curious right?
- Right click on the .cmd file and select: Run as administrator. (No, Run as administrator? Select Open instead… and consider updating your OS one day.)
- The command file will run for a moment and then report an error at the end. Something about failing to update the registry. Doesn’t matter, that’s a Windows XP fix that is only necessary if you’re running XP.
- Reboot your computer.
- Start IE and attempt to print. Fixed? Worked for me.
References:
RFC 1925 – The Twelve Networking Truths
A classic, from April 1996, RFC 1925 – The Twelve Networking Truths.
My favorites:
(5) It is always possible to aglutenate multiple separate problems
into a single complex interdependent solution. In most cases
this is a bad idea.
and
(12) In protocol design, perfection has been reached not when there
is nothing left to add, but when there is nothing left to take
away.
Reference:
