Search This Blog

Thursday, August 22, 2013

OpenSuse easily configure open ports in Firewall

Edit the file:


Add "your_service_name" to FW_CONFIGURATIONS_EXT like this:

FW_CONFIGURATIONS_EXT="sshd your_service_name"

create the file:


The file should have the following line:

TCP="80 890 891"

MONO compile error mono CS1566: Error reading resource file `big5.table'

I stumbled upon an error while compiling MONO:

mono CS1566: Error reading resource file `big5.table'

It turned out that I had moved the catalog with MONO source code without saving permissions and omitting hidden files - I just packed them folder with GUI KDE compress tool.

 When you want to move the source to another machine: use good old console tar.

to compress:
tar cvzpf compressed.tar.gz ./folderToCompress

to decompress:
tar xvzpf compressed.tar.gz

Wednesday, August 21, 2013

Windows - 7zip default temp directory

If you extract an extremely large file (like > 50 GB or so) and you end up with no space - the 7zip application can hang. Where should you look for the extracted file that is locking your HD space?

The default 7zip temp directory is:


Windows - register VirtualBox VBox machine in a single *.bat file from *.vbox file in the current working directory folder

To register VirtualBox machine in a single *.bat file from *.vbox file in the current working directory folder on Windows use the following commands:

"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" registervm %~dp0\MonoSuse.vbox
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" registervm %cd%\MonoSuse.vbox

Wednesday, August 14, 2013

OpenSuse Mono enable binding on low port numbers/ open low ports

1. You need to install "capabilities" library on OpenSuse.
zypper install libcap-progs
zypper install libcap1
zypper install libcap2

2. Allow mono to bind on low ports numbers:

setcap 'cap_net_bind_service=+ep' /usr/bin/mono-boehm

Now you'll be able to run .NET programs that bind on port numbers (below 1024) that are traditionally reserved for root (require root privileges). Traditional UNIX implementations distinguish two categories of processes: privileged processes (whose effective user ID is 0, referred to as superuser or root), and unprivileged processes (whose effective UID is nonzero). Privileged processes bypass all kernel permission checks. In order to run a process as non-root and bind to a port <1024 you need to give that binary a net_bind_service capability.

Tuesday, August 13, 2013

Drop/Create a postgresql database from script/ from console

$echo your_postgres_user_password | sudo -S -u postgres psql -c "create database database_name"

$echo your_postgres_user_password | sudo -S -u postgres psql -c "create database database_name"

OpenSuse 12.3, MonoDevelop 4.0.12 - no source code visible, no code visible in CodeView, gray windows instead of code

After compiling MonoDevelop from clean source no code is visible in the editor - instead a clean, gray window is displayed. To resolve the issue just export an appropriate env variable:


and then run monodevelop as you'd normally do:

$ monodevelop

Monday, August 12, 2013

OpenSuse 12.3 Postgresql autostart start at boot

#systemctl start postgresql.service
#systemctl enable postgresql.service

"start" starts the postgresql server and the "enable" part is supposed to start the server at boot.

Monodevelop MONO x64 amd_x64 amd64

Even though mono compilation was successful on my x64 OpenSuse installation, I stumbled upon the following error when opening/compiling .NET project:

Mono.Unix.Native.Syscall ---> System.EntryPointNotFoundException: Mono_Posix_Syscall_get_at_fdcwd

The solution turned out to be adding the following switch to MONO's autogen script:

My whole compilation script was:
cd /home/jmd/monoFoka/
./ --prefix=/usr --libdir=/usr/lib64
make install

The whole body of the exception:
System.TypeInitializationException: An exception was thrown by the type initializer for Mono.Unix.Native.Syscall ---> System.EntryPointNotFoundException: Mono_Posix_Syscall_get_at_fdcwd
  at (wrapper managed-to-native) Mono.Unix.Native.Syscall:get_at_fdcwd ()
  at Mono.Unix.Native.Syscall..cctor () [0x0000a] in /home/user/mono/mcs/class/Mono.Posix/Mono.Unix.Native/Syscall.cs:2168 
  --- End of inner exception stack trace ---
  at MonoDevelop.Core.LoggingService.RedirectOutputToFileUnix (FilePath logDirectory, System.String logName) [0x0001f] in /home/abuild/rpmbuild/BUILD/monodevelop-3.0.6/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs:177 
  at MonoDevelop.Core.LoggingService.RedirectOutputToLogFile () [0x00046] in /home/abuild/rpmbuild/BUILD/monodevelop-3.0.6/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs:140 

Friday, August 2, 2013

Android 4.0 and up - How to properly get (active) display dimensions

WindowManager wm = (WindowManager) getApplicationContext().getSystemService(Context.WINDOW_SERVICE);
Display display = wm.getDefaultDisplay();
Point displaySize = new Point();
int width = displaySize.x;
int height = displaySize.y;