The find utility on linux allows you to pass in a bunch of interesting arguments, including one to execute another command on each file. We’ll use this in order to figure out what files are older than a certain number of days, and then use the rm command to delete them.
Example:
find /path/to/files* -mtime +5 -exec rm {} \;
HOWTO make UTF-8 default encoding in mysql command-line
Add the line
default-character-set=utf8
to [mysql] sections of my.cnf (/etc/my.cnf on some systems , /etc/mysql/my.cnf on Ubuntu, use find or locate to find out).
You may wish to add the line to [client] section instead to make all clients use UTF-8 encoding for all connections.
HOWTO read twits of an user via an RSS aggregator
Prevent nouveau driver from loading in CentOS/RHEL 6.x
To install NVIDIA closed source driver, open-source nouveau drivers should be disabled.
Older post shows how nouveau drivers could be blacklisted on some popular distros. That recipe is not enough for CentOS 6.x.
You should also edit /etc/grub.conf and reboot.
Just add rdblacklist=nouveau to the end of line with kernel directive in grub.conf file.
Using KDE widgets with Qt Creator/qmake on Ubuntu
To compile/link Qt programs with KDE 4 libraries using qmake build system:
- Install the kde lib development package:
sudo apt-get install kdelibs5-dev
- Specify kde user interface libraries in
.pro file:
LIBS += -lkdeui
TROUBLESHOOTING: Ubuntu 12.04 and NVIDIA
I had garbled output in console when installing ubuntu server amd64 on computer with Nvidia Quadro 2000. I was able to log-in, but all output was completely unreadable.
As it turned out, the problem was in nouveau video driver, which is incompatible with some nvidia cards. I was able to login in recovery mode; other choices are boot some other linux form CD or USB or login via ssh from some other computer.
After getting access to filesystem, you should disable nouveau driver by adding
new file with .conf extension to /etc/modprobe.d
/etc/modprobe.d/disable-nouveau.conf:
blacklist nouveau
options nouveau modeset=0
*NIX tool improvements (V)
curl --write-out %{http_code} --silent --output /dev/null URL
*NIX Tools improvements (IV)
Fixing Visual Studio Express error when cleaning 64-bit projects using CUDA 4.1 nvcc compiler
This recipe may also apply to CUDA 4.0 and 4.2.
When you install VS Express edition alongside with Windows SDK 7.1 you can create 64-bit binaries. With properly installed CUDA SDK, 64-bit cuda code could also be built. Except for one thing: you may not clean or rebuild projects with files compiled by nvcc. You are able only to build those projects.
If you get an error similar to
<…>\CUDA 4.1.targets(445,9): error MSB3721: The command <…> exited with code -1.
the following solution may help:
- Note the installation path of VS Express. It contains text “
Microsoft Visual Studio 10.0\”. You may right-click on program shortcut that launches Visual Studio IDE and see properties to find where it is installed. Let’s assume your installation is C:\Program Files (x86)\Microsoft Visual Studio 10.0\
- You should then create file
C:\Program Files (x86)\Microsoft Visual Studio 10.0\vc\bin\amd64\vcvars64.bat (use path to actual location of your installation) with the content:
CALL %sdkdir%bin\SetEnv.cmd /x64
That’s it. You should be able to clean and rebuild your project/solution without errors.
Troubleshooting long ssh connect time
If you have problems with slow response from (some) ssh hosts, try editing
/etc/ssh/ssh_config
on your client box and set
GSSAPIAuthentication no
This may help. Alternatively, you may put this line in your ~/.ssh/config
HOWTO find working directory of a linux process
Use pwdx <PID> , e.g.:
pwdx 12345
HOWTO recursively convert all text files from windows to unix line endings
find . -type f -exec dos2unix {} +
The way to tell 64-bit from 32-bit executable on Windows
Using utilitites from WinSDK
dumpbin /headers some.exe | findstr "machine"
You get output like:
8664 machine (x64)
or:
14C machine (x86)