How to empty swap

1 minute read Bad applications does Bad stuff with you Memor. Today my Skype decide to flood my Memory. Lucky i notified this on the right time and was able to run killall -9 skype . But what left is a overfileld Memory and swap. For the Memory itself no problem, the kernel will empty it by demand. But for my older hard drive takes ages to get it back. So the best is it to empty it. The best way to do it: swapoff/swapon.
swapoff /dev/sdb5
This take now a while but it will do the job. When it's done re-enable it with 
swapon /dev/sdb5

Debian PostgreSQL 8.4 can't create Database with UTF-8 Encoding

2 minute read The Problem I encounter a  problem with fresh  Debian VM. I create this VM for our developer, during the installation script following problem appears and stop the script:
new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
HINT:  Use the same encoding as in the template database, or use template0 as template.
psql:./__cre_database.sql:76: \connect: FATAL:  database "db" does not exist
psql: FATAL:  database "db" does not exist
All database in postgres was created with SQL_ASCII The Solution You have to take care that you have a right UTF-8 setting in your bash environment. When you no LC option set, the default POSFIX will be used. 
postgres=# \l
List of databases
Name    |  Owner   | Encoding  | Collation | Ctype |   Access privileges  
-----------+----------+-----------+-----------+-------+-----------------------
postgres  | postgres | SQL_ASCII | C         | C     | : postgres=CTc/postgres
template0 | postgres | SQL_ASCII | C         | C     | =c/postgres                                                      
template1 | postgres | SQL_ASCII | C         | C     | =c/postgres
                                                       : postgres=CTc/postgres(3 rows)
A check on the locale show's me that there is no UTF-8 support. The Solution is very easy. Enable UTF-8 on the Bash:
export LANG="en_US.UTF-8"
Note: You should add this to your /etc/profile! After  this, re-install postgres via apt-get:
apt-get remove --purge postgresql-8.4 && apt-get install apt-get install postgresql-8.4
Now your Postgres Databases are in UTF-8.

Skypetab-ng on Gentoo

1 minute read Like a lots of people, i don't like skype but have to use it. For work and also a lots of friends. But the Skype GUI is very "feature"-less and gives sometimes hard times to deal with it. Thanks to skypetab-ng it get at least some "usability" . I tried to run this by Hand, but for some reason the Compile wasn't able to create a 32-bit library.I just found a nice Overlay for  Skypetab-ng, thanks to the Gentoo Forum!
To work with the Overlay, just add the rion overlay to your system:
layman -a rion
All what's left to do is a eix-sync and just install with emerge skypetab-ng
Sources: Gentoo Forums Post about Skypetabs
Overlay Webpage for Skypetabs-ng
skypetabs-ng

My Blog

1 minute read So this is now my Blog. For ages now i planed to made a blog. Here some thinks about it.
I will post so much as possible, when the time it allowing. Goal of this blog: This blog should cover mainly documentation about my work and problem of the everyday working. About me: My Name is Alex and I’m a System Administers in a small company Germany Berlin. Since August I’m working full time. My work is not limited to System Administration only,  also i working as Python Developer. My working task covering almost everything that is happening in the company. Work: My main working software is Linux. I take care about the Mail and Web Server. This all running in a Virtual environment hosted by Xen. More detail about this in a later post. But also lots of small gems of the IT world like Git, Jabber, Asterisk, Django and Postgresql. Also some bad one, like Orace 10g or Windows Server 2003. But overall it’s a dream job.

1 minute read

Buffer overflow

What’s a buffer?

a container in witch are sets of data are arranged in.

In this content we mean a series of data that a related.

It’s a stack overflow. Why Stack overflow? Because we can write more data into the stackframe as it’s size allows. In the end we’ll overwrite the EIP of the stackframe and beyond, leading to a error by writing to another era

The word ‘buffer’ in this topic is a reference to the data structure ‘stack’.

, like an array. It a serias of pointer.

The idea is following

int a int b

instead of wrting foreach n (2 in this case) variable you a simplefy way of initialzing n variable in memory

int a[2];

This is done with pointer. Basiccly every name is a point to a datastrcure in memeory.

2 minute read

With this document, I’ll try to illustrate two essential aspects of security. First of all a technical flaw and second of all, a general approach to security flaws.

Security flaws in general, are uncovered code paths, that one has forgotten to address. As an example: A buffer overflow is a misbehaviour in the memory management of a program. This flaw might allow an attacker to take over the execution flow of a program. Redirecting it to his own desire. However, this does not include flaws in software design or architectures. Many other defects related to this type concept. But not all.

This type of defect as an important implication: An specially formatted input causing a misbehaviour in a program. This misbehaviour can be exploited for different purposes. Typical implication might be:

  • Spoofing
  • Tampering
  • Repudiation
  • Information Disclosure
  • Deny of Service
  • Elevation of privileges

A features exist. A developer builds a program with this feature It has behaviour one might not be aware of. An attack can exploit this unhandle corn cases.

How’s a programm organized?

A binary file isn’t a magical piece. It consinste of strcutre and logic.

What’s the Heap?

The Heap is a assigned chunk of memory. It will be allocated by the operation system when an application requests memmory.

When a programm is running it can ask the operat

In other words: Memeory that’s allocated yet not used by now.

Example in C:

int a printf(“This is the address of a: %p”)

1 minute read

Calendar on the console:

Need a client for calendar on the shell

pcal is nice, but has no support for calendar sync like a owncloud.

Using the example from eric-scheibler with vdirsync However it’s a little bitt out-dated

Installation via archlinux aur

For the URL open the https:///index.php?redirect_url=%2Findex.php%2Fapps%2Fcalendar%2F#

Place it in the configuration file of vdiry

Example: https:///remote.php/dav/calendars/alexander/university/

Check on the offical documentation: https://vdirsyncer.readthedocs.io/en/stable/

You can get an example configuration from the project on github https://github.com/pimutils/vdirsyncer/blob/master/config.example

eNext is to install a client to display the calendar, I’m using the same programm as eric-scheibler suggested.

Note: Also in khal we have some changes that are documented here.

Important: Check http://lostpackets.de/khal/configure.html#

In addition I go the vacation calendar from http://www.ifeiertage.de/

very useful

Sources: https://linuxaria.com/pills/pcal-calendario-da-linea-di-comando http://eric-scheibler.de/en/blog/2014/10/Sync-calendars-and-address-books-between-Linux-and-Android/#linux-console https://vdirsyncer.readthedocs.io/en/stable/ http://lostpackets.de/khal/configure.html# http://lostpackets.de/khal/usage.html https://github.com/pimutils/vdirsyncer https://raw.githubusercontent.com/pimutils/khal/master/khal.conf.sample http://www.ifeiertage.de/