677 Beacon St. Rm. 201

Boston, MA 02215

zantiago at gmail.com

857.236.7988

HomePage


KoolStuff


pmwiki.org

*

Remember

Remember


I decided to start writing a sort of Knowledge Base with various fixes and tricks that I would prefer not to forget.

Linux stuff



Monitor NVIDIA card status...

watch -n 0.5 nvidia-smi

Quick swap space on USB storage


cd /media/odroid/yourusb/
dd if=/dev/zero of=/media/odroid/yourusb/yourswap bs=1M count=1024
mkswap /media/odroid/yourusb/yourswap
sudo swapon /media/odroid/yourusb/yourswap

Wireless router in Ubuntu 14.04


Access point configuration and DHCP server from here

1. Install hostapd: sudo apt-get install hostapd
2. Hostapd may not be compatible with wireless card. In that case this may be a solution
3. Create hostapd configuration file hostapd.conf
4. Install DHCP server: sudo apt-get install isc-dhcp-server
5. Configure it by editing /etc/dhcp/dhcpd.conf. Key entries are shown here
6. Wifi hotspot can be initialized like this


Desktop configuration file (launcher / shortcut)


Use the shortcut editor or create a yourname.desktop file with something that looks like this inside:

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Exec=lxterminal -e /path/to/your/script.sh
Name=name
GenericName=name
Comment=comment
Encoding=UTF-8
Terminal=false
Type=Application
Categories=Application;
StartupNotify=true
Path=/your/working/directory/here
Icon=image
Comment[en_US]=comment


C/C++


QT Creator Unknown error when debugging


Does not seem to be Ubuntu/QT/CMake version specific. The workarround is: Deleting the CMakeLists.txt.user file and reopening the project works. May be restart QT :(

sqrt() is very slow


If multiple calls to sqrt cannot be avoided this can help. The best method looks like this:

double inline __declspec (naked) __fastcall sqrt14(double n) {

	_asm fld qword ptr [esp+4]
	_asm fsqrt
	_asm ret 8

}

JAVA


The libnb-javaparser-java package is newer than the Netbeans installation

The fix is to manually downgrade your version of libnb-javaparser-java, to match the version of netbeans that's installed. You can do this with:

wget http://archive.ubuntu.com/ubuntu/pool/universe/libn/libnb-javaparser-java/libnb-javaparser-java_7.0.1-1_all.deb
sudo dpkg -i libnb-javaparser-java_7.0.1-1_all.deb

Restart Netbeans.

Check/modify java version

sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws

Page last modified on February 06, 2017, at 10:51 AM