25 Sep 2014, 7:10pm
linux:

leave a comment




  • Anzeige
  • Setting up a linux server to forward all incoming mails

    Typ­i­cal thing when hav­ing a new site up: you want to get whatever@yourdomain.com to end up in you nor­mal inbox, say Gmail.

    Here are the steps!
    Note: If you are logged in as root, you do not need to use “sudo” in front of each command.

    Prepa­ra­tions

    It’s rec­om­mended to have a user account to receive the mail other than root.
    So either choose a user you have cre­ated already or cre­ate a new one:

    sudo adduser [username]

    Does your provider require you to use an SMTP relay? (check the doc­u­men­ta­tion, or ask). You need to know this to continue.

    Install post­fix

    Post­fix is a soft­ware pack­age, a MTA, it han­dles incom­ing mail and forwarding.

    sudo apt-get install postfix

    And answer all con­fig­u­ra­tion ques­tions as below:
    Server con­fig­u­ra­tion type: If you use an SMTP relay, choose “Inter­net with smarthost”, oth­er­wise “Inter­net“
    Sys­tem mail name: [yourdomain.com] (no sub­do­main)
    SMTP relay host: [smtp.yourprivider.com] (only show­ing if you chose “Inter­net with smarthost”)
    Root and post­mas­ter mail recip­i­ent: The created/chosen before (not root)
    Other des­ti­na­tions to accept mail for: keep the sug­gested defaults and add in front [yourdomain.com] and a space
    Force syn­chro­nous updates on mail queue: no
    Local net­works: keep sug­gested
    Use proc­mail for local deliv­ery?: yes
    Mail­box size limit: 0
    Local address exten­sion char­ac­ter: +
    Inter­net pro­to­cols to use: all

    Man­ual configuration

    All edits with sudo if you not logged in as root.
    Edit /etc/postfix/main.cf add fol­low­ing two lines to the end

    virtual_alias_domains = [yourdomain.com]
    virtual_alias_maps = hash:/etc/postfix/virtual

    Create/edit /etc/postfix/virtual and add

    @[yourdomain.com]    [your.email.address@somewhere.com]

    Finally, after edit­ing this file call

    sudo postmap /etc/postfix/virtual

    so that postmap actu­ally applies your changes.

    Notes

    If you for­ward to Gmail, do not use the same address to send test mails that the mails will be for­warded to — Gmail will silently ignore/delete mail where the sender and recip­i­ent are the same and you will think the for­ward­ing does not work.

    26 Dec 2013, 12:25pm
    linux:

    leave a comment




  • Anzeige
  • Scale images for the web — quickly

    Start­ing Gimp just to scale down some pho­tos to send them by mail? Meh.
    How about mark them, right-click, “Send To” -> “Scale for web”?
    No prob­lemo:
    First, get a tool to scale images:

    sudo apt-get install imagemagick

    Now, cre­ate a script that takes a list of images as input, scales them down, and stores them with a pre­fixed file name. Go!

    #!/bin/bash
    pwd > ~/f0.txt
    echo "$@" > ~/f1.txt
    for file in $@
    do
    	convert "$file" -quality 50 -resize 1024x768 "${file%/*}/web-${file##*/}"
    done

    Make sure we chmod +x the script file we just cre­ated.
    Next, let’s inte­grate it into “Send To”. (This is an exam­ple for Thu­nar)
    Cre­ate a .desktop file in the sendto folder, e.g. /usr/share/Thunar/sendto/scale-for-web.desktop with fol­low­ing content:

    # Scale images for the web
    [Desktop Entry]
    Type=Application
    Version=1.0
    Encoding=UTF-8
    TryExec=scale-for-web
    Exec=scale-for-web %F
    Icon=
    Name=Scale for the web
    MimeType=image/jpeg;image/jpg;image/png
    

    Replace both scale-for-web with the name you gave to your script file. Is the script’s folder in $PATH? No idea? Then just put the entire path+filename.
    Now, open Thu­nar, select some images (Jpeg or Png), right-click, “Send To” -> “Scale for the web”, wait a few sec­onds and you’ll see web-....jpg files appear­ing in the same folder. :)

    Ref­er­ences: how to scale images with imageMag­ick, extract path seg­ments, more details on string manipulation

    14 May 2012, 8:27pm
    linux recommendations:

    4 comments




  • Anzeige
  • Missing Digikam Themes w/t KDE

    Digikam is a great tool to man­age and work on pho­tos — my per­sonal favorite for some years already. But it’s made for KDE and uses a lot of KDE-related libs and stuff, there­fore, installing it in Gnome, Xfce, Lxde and the like will cost about 1gb because of the depene­den­cies.
    Nev­er­the­less, worth it. But it comes with a bright default skin ren­der­ing it com­pletely unus­able for work­ing seri­ously on light and color set­tings of photos.

    To add themes, you will have to install an extra pack­age (as decribed here) like this:
    sudo apt-get install kde-workspace-data
    Yes, this will add more data to your disk, but only 10mb this time. ;)

    Happy photo-tweaking!

    8 May 2010, 11:25am
    linux:

    leave a comment




  • Anzeige
  • Resizing System or Home Partion

    A very con­ve­nient tool for cre­at­ing, mov­ing, and resiz­ing par­ti­tions is GParted. I use it for all my partition-changing-needs — it is really pow­er­ful and yet easy to use! :)

    But it is not pos­si­ble to resize sys­tem rel­e­vant par­ti­tions while the sys­tem is run­ning — makes sense, right? ;)

    But you can down­load GParted as LiveCD ISO file and burn it on a CD. After that, restart your com­puter with the CD in your drive and a small linux will start up directly from CD includ­ing GParted, thus allow­ing you to mod­ify any drive and par­ti­tion there is. :) Do all required changes, click the exit but­ton and you are done. In my case, the com­puter did not reboot auto­mat­i­cally, instead I ended up with a com­mand line inter­face — use the com­mand “sudo reboot” to restart the sys­tem your­self if that happens.

    And just by the way, GParted does also han­dle Win­dows par­ti­tions eas­ily — so there is no need to buy or “get” Par­ti­tion Magic from some­where. But never for­get to backup your data first.

    Yet another hint: GParted works most reli­able if you do one step at a time. So for exam­ple, there are par­ti­tions A and B (A is in front of B) and you wish to give some of the free space in A to B. You need to do fol­low­ing steps: Shrink A, move B left and finally grow B. From my expe­ri­ence, GParted works best if you really do all those steps sep­a­rately, apply each of then, and go for the next one if the last one fin­ished successfully.