Python Editor for Human Resource Machine

Hello, I started to learn python a few months ago. To find a motivation and reason to learn more and more I searched for a project. I found these project while I was playing Human Resource Machine.

I thought that it would be nice if I could write the commands in an editor like writing code in an IDE. Now I already have some working code and shared it on Github.

HRM-Editor Github.com.

Project details
  • Python 3
  • TkInter
Target

Python editor usable to code for Human Resource Machine.

If you are interested, be welcome ;)

Archlinux/Raspberry Pi - Setup SCM-Manager

SCM-Manager

SCM-Manager is a lightweight version control server. SCM-Manager manages 3 systems: GIT, Subversion and Mercurial.

And it provides an easy installation and plugin support for stuff like LDAP authentication and much more.

Links/Download

JSVC: Needed to execute SCM-Manager in daemon mode, but not shipped for arm cpu

Set-By-Step

  1. Download required software First download required software (SCM-Manager and JSVC) like:

    wget https://www.scm-manager.org/download-action/?download=/scm-server/1.46/scm-server-1.46-app.tar.gz
    wget http://mirror.archlinuxarm.org/armv6h/extra/java-jsvc-1.0.15-2-armv6h.pkg.tar.xz
    
  2. Create directories and unpack

    # untar downloaded archives
    tar -zxvf scm-server-1.46-app.tar.gz
    tar -xvJf java-jsvc-1.0.15-2-armv6h.pkg.tar.xz
    
    # move folder to opt
    sudo mv -v scm-server /opt/scm-server
    
    # create basedir for server
    sudo mkdir /var/scm
    
    # move jsvc to server libs
    sudo mv -v  usr/bin/jsvc /opt/scm-server/libexec/jsvc-linux-armv6l
    rm -Rv usr
    
    # optional: remove downloaded
    rm scm-server-1.46-app.tar.gz
    
  3. Create new group and user scm for server

    sudo useradd -rUs /usr/bin/nologin scm
    
  4. Add your user to group scm

    sudo gpasswd -a $USER scm
    

    Relogin after this step

  5. Change directory owner and permissions

    # configure like tomcat http://superuser.com/a/825867/550494
    
    sudo chown -Rhcv root:scm /opt/scm-server
    sudo chmod -cv 750 /opt/scm-server
    
    sudo chown -hcv root:scm /opt/scm-server/README.txt
    sudo chmod -cv 640 /opt/scm-server/README.txt
    
    sudo chown -Rhcv root:scm /opt/scm-server/bin
    sudo chmod -Rcv 740 /opt/scm-server/bin
    
    sudo chown -Rhcv root:scm /opt/scm-server/conf
    sudo chmod -Rcv 640 /opt/scm-server/conf
    
    sudo chown -Rhcv root:scm /opt/scm-server/lib
    sudo chmod -Rcv 640 /opt/scm-server/lib
    
    sudo chown -Rhcv root:scm /opt/scm-server/libexec
    sudo chmod -Rcv 750 /opt/scm-server/libexec
    
    sudo chown -Rhcv root:scm /opt/scm-server/var
    sudo chmod -Rcv 660 /opt/scm-server/var
    sudo chmod -R gu+S /opt/scm-server/var
    
    sudo chown -Rhcv scm:scm /opt/scm-server/work
    sudo chmod -Rcv 660 /opt/scm-server/work
    sudo chmod -R gu+S /opt/scm-server/work
    
    sudo chmod -Rcv ug+X /opt/scm-server
    
    sudo chown -Rhcv scm:scm /var/scm
    sudo chmod -Rcv 6770 /var/scm
    sudo chmod -Rcv gu+s /var/scm
    
  6. Configure server
    Change the user to scm and set working dir
    nano /opt/scm-manager/bin/scm-server
    USER="scm"
    
    EXTRA_JVM_ARGUMENTS="-Dscm.home=/var/scm -Djava.awt.headless=true -Dlogback.configurationFile=logging.xml"
    
  7. Start daemon

    # scm-server <start|stop>
    sudo /opt/scm-server/bin/scm-server start
    
  8. Check logs

    sudo tail -fn 50 /opt/scm-server/var/log/scm-server.out
    
  9. Open SCM-Manager

    server http://[server]:8080
    adminuser scmadmin
    password scmadmin

Der Anfang

Gleich vorweg, dies ist kein minuziöser gepflegter Blog, dies ist mehr mein Notizbuch für Dinge, die ich mir merken möchte. Ich suche schon länger ein geeignetes Format, in dem ich mein Gelerntes niederschreiben kann.

Ich habe schon einiges versucht, von einem Blog bei Blogger bis zu einem privat gehosteten Confluence, dessen Administration mir aus zeitlichen Gründen nicht zusagt.

Wichtig für mich, war das schnelle niederschreiben meines Wissens, so dass ich immer schnell Zugriff habe.

Grüße…

JSF Livecycle

Life Cycle

Phasen

(Übernommen von Tutorialspoint)

Phase 1: Restore view

JSF begins the restore view phase as soon as a link or a button is clicked and JSF receives a request. During this phase, the JSF builds the view, wires event handlers and validators to UI components and saves the view in the FacesContext instance. The FacesContext instance will now contains all the information required to process a request.

Phase 2: Apply request values

After the component tree is created/restored, each component in component tree uses decode method to extract its new value from the request parameters. Component stores this value. If the conversion fails, an error message is generated and queued on FacesContext. This message will be displayed during the render response phase, along with any validation errors. If any decode methods / event listeners called renderResponse on the current FacesContext instance, the JSF moves to the render response phase.

Phase 3: Process validation

During this phase, the JSF processes all validators registered on component tree. It examines the component attribute rules for the validation and compares these rules to the local value stored for the component. If the local value is invalid, the JSF adds an error message to the FacesContext instance, and the life cycle advances to the render response phase and display the same page again with the error message.

Phase 4: Update model values

After the JSF checks that the data is valid, it walks over the component tree and set the corresponding server-side object properties to the components’ local values. The JSF will update the bean properties corresponding to input component’s value attribute. If any updateModels methods called renderResponse on the current FacesContext instance, the JSF moves to the render response phase.

Phase 5: Invoke application

During this phase, the JSF handles any application-level events, such as submitting a form / linking to another page.

Phase 6: Render response

During this phase, the JSF asks container/application server to render the page if the application is using JSP pages. For initial request, the components represented on the page will be added to the component tree as the JSP container executes the page. If this is not an initial request, the component tree is already built so components need not to be added again. In either case, the components will render themselves as the JSP container/Application server traverses the tags in the page. After the content of the view is rendered, the response state is saved so that subsequent requests can access it and it is available to the restore view phase.

PreRenderView vs. PostConstruct

Archlinux/Raspberry Pi - Issues, Notes and Links

Known issues

Pacman -Syu failed

Symtom
command: pacman -Syu
    error: failed to initialize alpm library
    (database is incorrect version: /var/lib/pacman/)
    error: try running pacman-db-upgrade

****************************************

command: pacman-db-upgrade
    ==> ERROR: You must have correct permissions to upgrade the database.

Reason:

The system is executet in read-only mode, to change this you have to change /boot/cmdline.txt. Add rw in front of rootwait. Then reboot the system.

If there are issues with the pacman database just upgrade it:

pacman-db-upgrade

Quelle: RaspberryPi.org


Notes

Change Hostname

echo myhostname > /etc/hostname

Optional there is an aditional place:

/etc/hosts
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain localhost myhostname
::1   localhost.localdomain localhost myhostname