I made a change in the blogger configuration to ease the later work when blogging. It is possible that older entries are not correctly formatted.

Saturday 29 June 2013

GDM Configuration

Well I learned something about the GDM configuration by reading the well written gnome gdm manual. However, that did not solve my Gnome cofiguration problems.

But at least I know a little bit more how to configure the user screen and put useful on it through the use of an Xwilling script.

Friday 28 June 2013

Systemd und service control under fedora

I must say I am currently a bit lost in the different mechanisms to start and stop services. I used to perform these tasks with the standard /etc/init.d/... scripts. But it seems that it does not work completely in this way. There seems to be now systemctl, service and chkconfig commands.

service sshd start

to start the ssh daemon.

service sshd stop

to stop the ssh daemon.

chkconfig sshd on

to enable the ssh daemon so as to start it after boot.


To use systemd, the following commands come handy:

systemctl start sshd.service

to start the ssh daemon.

systemctl stop sshd.service

to stop the ssh daemon.

systemctl enable sshd.service

to enable the ssh daemon so as to start it after boot.




Monday 24 June 2013

python useful packages in combination with command line

I have been playing with python lately and discovered at least two small utility pacages providing useful features in combination with the commandline. For this reason I created two aliases:

alias openurl='python3 -m webbrowser -t'
alias webshare='python -m SimpleHTTPServer'

The first one opens a web page at the url given as a parameter, if the url does not have a protocol, e.g. http, then the command will interpret it as a local file. The second one starts a webserver for the directory where the command is called. Then you can provide in that way a simple mean of letting someone download local files.

Sunday 23 June 2013

PAM authentication with multiple passwords

I just learned that it is possible to perform cascading failing authenthication. In that way it is possible to use different passwords, for example password with ldap or passwords with the shadow file. When a user logs in with his local password, the configured system would first try to log in with the ldap password for instance, which would fail, then the pam module for the local shadow file would be used.


I discovered this when reading about barada (see sourceforge page). This project offers the possibility of creating a nice remote password mechanism where a token can be obtained from a telephone app, for instance an android. It uses the HOTP protocol described in this RFC.

Friday 21 June 2013

cmd Hell No! different colored text does not seem that easy

I have been looking for a cool way to change the color of a part of the text in the command prompt... But this proved to be a time stealer, because there does not seem to be any easy way to do it. There are some complex ways but I am not going to look into them.

Create simple GUIs to your scripts - HTA files

While looking for a way to help my grilfriend be more productive I found ut that one can create hta files. The following example is with VB. I have to see if it is possible to use other kind of scripts.


<head>
<title>HTA Test</title>
<HTA:APPLICATION
APPLICATIONNAME="HTA Test"
SCROLL="yes"
SINGLEINSTANCE="yes"
WINDOWSTATE="maximize"
>
</head>

<script language="VBScript">
Sub TestSub
Msgbox "Testing 1-2-3."
End Sub

Sub GetOSVersion
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" &strComputer & "\root\cimv2")

Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")

For Each objOperatingSystem in colOperatingSystems
Msgbox objOperatingSystem.Caption &" " &_
objOperatingSystem.Version
Next
End Sub
</script>

<body>
<input type="button" value="Run Script" name="run_button" onClick="TestSub"><p>
<input type="button" value="Get OS Version" name="run_button" onClick="GetOSVersion"><p>

</body>

This may turn out to be useful once or twice. But I would hate to have to program in visual basic.
There was actually an example how to create a simple selection list in powershell. But I have not tried the described there, but the page might be useful to you

Thursday 20 June 2013

emacs Malabar Mode

Emacs Malabar is an emacs mode for editing java with emacs. While browsing I found this stackoverflow entry. I still have to dig into it, but it seems to have very useful properties (according to the Stack overflow answer):

  • tight maven integration
  • groovy console for rapid prototyping
  • junit integration
  • import help
  • extra class, overide method and implement interface helpers
  • simplistic refactoring


An interesting extension to this work is to use also a mode for maven.

emacs JDE

Emacs JDE is an emacs mode for editing java with emacs. For a long time I wanted to dig into this again, because I find myself often annoyed by having to start eclipse for very simple java projects.


An interesting extension to this work is to use also a mode for maven.

World Simulation with Map Reduce

After a friend of mine has presented me a pet project of his and one of his friend: Wesen.
I thought of a few things one could do with MapReduce. In particular, I think it is interesting to
look at the use of map reduce for this kind of work.

The basic idea would be to first perform a map/reduce to choose which actions should be performed by the entities.
Then a second map/reduce to perform the action, and then finally a third map reduce to perform clean up operation

Another possibility is the use of a genetic algorithm and see how these evolve.

Using the powershell to download a file

A simple script to download a file:

$url="http://hostname/xxxxFiletoDownload"

$thisir =pwd

$path = $thisdir.toString() "\xxxxFiletoDownload"


$client = new-object System.Net.WebClient

$client.DownloadFile( $url, $path )


Thursday 13 June 2013

Http Only cookies

I just learned something about http-only cookies to prevent client code of the browser to temper with cookies. I found a little more information in this article:https://www.owasp.org/index.php/HttpOnly. To do this in Java for a cookie, write:


Cookie cookie = getMyCookie("myCookieName");
cookie.setHttpOnly(true);

In particular for the session cookie, you can use the following code:

SessionCookieConfig config = request.getServletContext().getSessionCookieConfig();
config.setHttpOnly(true);

Saturday 1 June 2013

OS DEV

This might not be really for me but just in case I should want to read a gain a little bit about the subject there is a nice site with informations for OS development: http://wiki.osdev.org/.

I should try to keep that in mind