Evaggelos Balaskas - System Engineer

The sky above the port was the color of television, tuned to a dead channel

Blog
Posts
Wiki
About
Contact
rss.png twitter linkedin github gitlab profile for ebal on Stack Exchange

Next Page »
  -  
« Previous Page
Aug
15
2010
Hibernation Part Two (#2)
Posted by ebal at 13:31:57 in planet_ellak, planet_Sysadmin

Some time ago, i wrote a
post
in greek of how easy is to use hibernation on linux desktops.

For some time now, i didnt use hibernation and in between i upgrade my laptop a lot of times.
For some strange reason the previous tested (kernel) solution didnt work perfectly.

So i just implement the second hibernation solution: uswsusp

This method provides a userspace suspend program that uses a lot of
scripts to hook your running modules, programs and memory data to a swap partition.

Simple as that in theory, i did small changes on my laptop.

  1. Installation
sudo pacman -S uswsusp
  1. Kernel HOOKS

Change the resume kernel hook from /etc/mkinitcpio.conf
to uresume (userspace resume)

HOOKS=”base udev autodetect pata scsi sata uresume filesystems”

Save the above file and then run this command:

mkinitcpio -p kernel26
  1. Configuration

Edit /etc/suspend.conf, so that the resume device is linking to your swap partition:

resume device = /dev/sda2

sda2 is my swap partition, just add your swap partition!

  1. Hibernate
sudo pm-hibernation

PS: I read in a lot of HowTos that you have to edit /boot/grub/menu.lst
to add resume path of swap partition, but believe me, thats not necessary!

  • 1 comment
Aug
02
2010
abs4snap to the rescue
Posted by ebal at 20:05:04 in blog, planet_ellak, planet_Sysadmin

On January i wrote a personal script to keep my package list and latest conf files on a backup-snapshot mechanism: abs4snap . Page on wiki: abs4snap for archlinux.

Today i wanted to delete some libraries from /usr/lib/ folder path!

And i did a little mistake :(

I wanted to write:


rm -f /usr/lib/libjsp*

but i wrote:


rm -f /usr/lib/lib*

Simple as that my distro (archlinux) becomes a jigsaw puzzles !
Just pieces here and there !

What the f@#$% i could do to save my distro ?

I am using archlinux, so my package manager is: pacman, but pacman uses libraries from /usr/lib folder path !

The solution was to reinstall my distro of course.

Or there is another way ?

A couple days before, i wrote a post how to build a static binary with: statifier. So i had my pacman package list and a pacman static binary file !

The solution was in front of me.

awk '{print "pacman-static -S --noconfirm " $1}' package-list | sh 

And with in a few minutes my distro and /usr/lib was in perfect mode again !!!

So remember:

BACKUP your data.

Jul
30
2010
build static packages with statifier
Posted by ebal at 17:53:41 in planet_ellak, planet_Sysadmin

A nice (but not perfect) tool to create a static package is: statifier

Here is a simple but useful mini how to:


(as root)

# echo -n 0 > /proc/sys/kernel/randomize_va_space

# ldd /usr/bin/pacman
    linux-gate.so.1 =>  (0xb7fe1000)
    libalpm.so.5 => /usr/lib/libalpm.so.5 (0xb7fa8000)
    libc.so.6 => /lib/libc.so.6 (0xb7e5d000)
    libfetch.so => /usr/lib/libfetch.so (0xb7e4f000)
    libarchive.so.2 => /usr/lib/libarchive.so.2 (0xb7e0f000)
    /lib/ld-linux.so.2 (0xb7fe2000)
    libssl.so.1.0.0 => /usr/lib/libssl.so.1.0.0 (0xb7dbd000)
    libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0xb7c43000)
    libacl.so.1 => /lib/libacl.so.1 (0xb7c3c000)
    libattr.so.1 => /lib/libattr.so.1 (0xb7c37000)
    libexpat.so.1 => /usr/lib/libexpat.so.1 (0xb7c11000)
    liblzma.so.0 => /usr/lib/liblzma.so.0 (0xb7bef000)
    libbz2.so.1.0 => /lib/libbz2.so.1.0 (0xb7bde000)
    libz.so.1 => /usr/lib/libz.so.1 (0xb7bc9000)
    libdl.so.2 => /lib/libdl.so.2 (0xb7bc5000)
    libpthread.so.0 => /lib/libpthread.so.0 (0xb7bab000)

# statifier /usr/bin/pacman /tmp/pacman.static-3.4.0

# ldd /tmp/pacman.static-3.4.0
    not a dynamic executable

# ls -l /usr/bin/pacman /tmp/pacman.static-3.4.0
-rwxr-xr-x 1 root root 4530176 2010-07-30 20:47 /tmp/pacman.static-3.4.0
-rwxr-xr-x 1 root root   70708 2010-06-21 15:54 /usr/bin/pacman

  • 3 comments
Jul
29
2010
mbox Deduplication using python
Posted by ebal at 18:31:28 in wiki, planet_ellak, code, planet_Sysadmin

A simple python script to deduplicate a mailbox (mbox format).


#!/usr/bin/env python
# Created by Evaggelos Balaskas on Thu Jul 29 21:22:41 EEST 2010
# Remove duplicate mails from mbox using message-id
 
import sys
import mailbox
 
if len(sys.argv) == 2:
        mid = []
 
        for message in mailbox.mbox( sys.argv[1] ) :
                s = message['message-id']
                if s not in mid:
                        mid.append(s)
                        print message
else:
        print "Usage should be: " + sys.argv[0] + " mbox > new.mbox"

You can take a look, also, on my other python script: How to remove specific mails from a mbox by subject

  • 1 comment
  -  
« Previous Page

Search

Admin area

  • Login

Categories

  • blog
  • wiki
  • pirsynd
  • midori
  • books
  • archlinux
  • movies
  • xfce
  • code
  • beer
  • planet_ellak
  • planet_Sysadmin
  • microblogging
  • UH572
  • KoboGlo
  • planet_fsfe

Archives

  • 2025
    • April
    • March
    • February
  • 2024
    • November
    • October
    • August
    • April
    • March
  • 2023
    • May
    • April
  • 2022
    • November
    • October
    • August
    • February
  • 2021
    • November
    • July
    • June
    • May
    • April
    • March
    • February
  • 2020
    • December
    • November
    • September
    • August
    • June
    • May
    • April
    • March
    • January
  • 2019
    • December
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2018
    • December
    • November
    • October
    • September
    • August
    • June
    • May
    • April
    • March
    • February
    • January
  • 2017
    • December
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2016
    • December
    • November
    • October
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2015
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • January
  • 2014
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2013
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2012
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2011
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2010
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
  • 2009
    • December
    • November
    • October
    • September
    • August
    • July
    • June
    • May
    • April
    • March
    • February
    • January
Ευάγγελος.Μπαλάσκας.gr

License GNU FDL 1.3 - CC BY-SA 3.0