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
Jun
13
2015
Assembling the Graef CM 800 grinder
Posted by ebal at 13:00:11 in blog

This post is for coffee lovers and is about how to assemble the Graef CM 800, which is a coffee grinder, after a proper clean up.
Has many images, so it may be “heavy” to browse. Click on every image for full size display.

 

Below are the removable parts.

Be CAREFUL the smallest parts are the most important !!!

Dont loose them !

01.Graef_CM_800.png

 

The internal part of our conical grinder.
This image is without the case and the coffee stopper

02.Graef_CM_800.png

 

Be very careful with the smallest parts.
Their job is to power on our grinder!

03.Graef_CM_800.png

 

Putting the coffee stopper case (you have to hear the click!).

04.Graef_CM_800.png

 

Screw the top to cover the internals.

05.Graef_CM_800.png

 

Adjust the collar by facing back (numbers must be in the back)

06.Graef_CM_800.png

 

Put the upper conical grinder part:

07.Graef_CM_800.png

 

And switch till it fits perfectly

07b.Graef_CM_800.png

 

Turn the adjustment collar clockwise, till it’s lock to your settings

08.Graef_CM_800.png

 

I mostly grind on the 10 setting and the result looks like this:

09.Graef_CM_800.png

 

and after tamping:

10.Graef_CM_800.png

 

Tag(s): Graef CM 800, Graef, coffee, grinder
    Tag: Graef CM 800, Graef, coffee, grinder
Jun
12
2015
Changing SSH Host keys
Posted by ebal at 21:54:08 in blog, planet_ellak, planet_Sysadmin

The inspiration for this post comes from Kees Cook’s tweet about having


VisualHostKey yes

on his ~/.ssh/config file.

I’ve played with this option in the past, but having some scripts running over ssh, I was afraid about parsing the “wrong” things on the output.

I’ve enabled this option again this evening, so the head of my ~/.ssh/config looks like:


Host *
    VisualHostKey yes
    Compression yes

I started to ssh login in to a few machines, just to see the output.

A sample output, looks like this:



+---[RSA 2048]----+
|.E       . . o   |
|= . .   . . o o  |
| +   o .  ..o. . |
|  o . o . .*.    |
|   .   +S...*. o |
|      . ...+o.+oo|
|        . +o  +.B|
|       . + oo+ +=|
|        . o.=o. .|
+----[SHA256]-----+

RSA 2048 is the size of the servers public key and you can check the size of the servers key -as of course yours too- with this command:


# ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub

on your local machine:


> ssh-keygen -l -f ~/.ssh/id_rsa.pub

I have changed a few times my ssh key pair (you must remember to append your new public key to your server authorized_keys, before removing your old key) but I never changed the servers key pairs.

After searching online for a few minutes to educate my self on the matter, seems that when your (in this case) centos machine is starting ssh daemon for the first time, it creates new ssh key pairs.

The procedure is really easy, but before doing anything, we need to edit

/etc/init.d/sshd to add a 4096 bit keysize for SSHv2 RSA:


echo -n $"Generating SSH2 RSA host key: "
rm -f $RSA_KEY
if test ! -f $RSA_KEY && $KEYGEN -q -b 4096 -t rsa -f $RSA_KEY -C '' -N '' >&/dev/null; then

The final steps are these:


> ssh linuxbox
> sudo -s
# cd /etc/
# tar cf ssh.tar ssh
# cd ssh
# rm -f ssh_host_*
# service sshd restart

If you test your ssh connection, you will get an ugly message:


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

BUT you have to see this error msg.

If you dont, then you have a very serious problem !

Edit your ~/.ssh/known_hosts to get rid of this message and delete the previous record about the old server ssh public key.

Try again, now it should show you something like:


Are you sure you want to continue connecting (yes/no)? yes

Type yes and memorize your new VisualHostKey !

Tag(s): ssh, centos
    Tag: ssh, centos
  • Add a comment
Jun
09
2015
Removing Ads with your PowerDNS Resolver
Posted by ebal at 21:45:54 in blog, planet_ellak, planet_Sysadmin, planet_fsfe

In my previous post , I documented my notes on setting up a new PowerDNS Recursor for our own clients.

In this post, I will present a simple way to reduce unnecessary traffic by blocking every FQDN you dont want.

 

 

Download a well known custom HOSTS file:

# curl -s -L http://winhelp2002.mvps.org/hosts.txt -o /etc/pdns-recursor/hosts.blocked

Add your FQDNs you want to block,

eg.
# echo "0.0.0.0 facebook.com" >> /etc/pdns-recursor/hosts.blocked

be very careful not to block something you need.
Reminder: No support for wildcards, only FQDNs

 

Edit your /etc/pdns-recursor/recursor.conf to support the new hosts file:

etc-hosts-file=/etc/pdns-recursor/hosts.blocked
export-etc-hosts=on

restart your pdns and test it

# dig www.facebook.com @localhost

;; ANSWER SECTION:
www.facebook.com.   86400   IN  A   0.0.0.0

Once you have done that, you can edit your hosts.blocked when ever you want!
But dont forget to reload:

# rec_control reload-zones

Tag(s): PowerDNS
    Tag: PowerDNS
Jun
09
2015
Build your own DNS Recursor with PowerDNS in five minutes
Posted by ebal at 20:19:04 in blog, planet_ellak, planet_Sysadmin

First rule of DNS: Always keep in separted machines your authoritative and recursor DNS server.

Disclaimer: The below notes are made on a fresh centos7 server. This is not an openresolver, is just for personal use. You need to adjust your settings.

 

 

PowerDNS is an amazing product. Has two flavors, one for Authoritative NS and one for Recursor. I always use @KeesMonshouwer RPMs for two reasons:

a. Works perfectly
b. I trust his work

 

  • Installation

    Let’s start, by installing the pdns-recursor:

    
    # rpm -ivh https://www.monshouwer.eu/download/3rd_party/pdns-recursor/el7/x86_64/pdns-recursor-3.7.2-1.el7.MIND.x86_64.rpm
    
  • User/Group

    Verify that you have the pdns User/Group, if not create them:

    
    # grep pdns /etc/group
    pdns-recursor:x:996:
    
    # grep pdns /etc/passwd
    pdns-recursor:x:996:996:PowerDNS Recursor:/dev/null:/sbin/nologin
    
  • root hint

    Create the hint (root NS) zone:

    
    # dig NS . @a.root-servers.net. | grep -vE '^;|^$'  | sort -V > /etc/pdns-recursor/root.hint
    

    I prefer to use and work with the opennicproject cause it’s an amazing community open DNS project. They also provide their own gTLDs and the majority of them dont have any logs at all or they anonymize the dns logs. In the times we are living, I prefer my DNS queries NOT to be obtained and recorded by companies.

    I strongly suggest to participate to this amazing community project.

    So my root.hint file is the result of this:

    
    # dig . NS @75.127.96.89 | grep -v '^;' | sort -u -V  > /etc/pdns-recursor/root.hint
    

    Dont forget to edit your /etc/pdns-recursor/recursor.conf so that you tell pdns where is your root hint file:

    
    hint-file=/etc/pdns-recursor/root.hint
    
  • ACL

    As i mentioned above, I dont want (at the current moment) to create an openresolver. So I need to create an ACL.

    That can be done by two ways (combined or separated).

  • iptables

    The first one is via iptables. My iptables default policy is DROP, so I need to ACCEPT tcp/udp traffic from the networks I want to provide dns recursion. The below example are for a specific IP and a class C (/24) network

    
    # TCP
    -A INPUT -p tcp -m state --state NEW -m tcp --dport 53 -s XXX.XXX.XXX.XXX -j ACCEPT
    -A INPUT -p tcp -m state --state NEW -m tcp --dport 53 -s YYY.YYY.YYY.0/24 -j ACCEPT
    # UDP
    -A INPUT -p udp -m state --state NEW -m udp --dport 53 -s XXX.XXX.XXX.XXX -j ACCEPT
    -A INPUT -p udp -m state --state NEW -m udp --dport 53 -s YYY.YYY.YYY.0/24 -j ACCEPT
    

    Dont forget to restart your iptable service.

  • ACL in pdns

    The second way is by configure the allow-from pdns setting accordingly:

    
    # vim /etc/pdns-recursor/recursor.conf
    
    allow-from=127.0.0.0/8, XXX.XXX.XXX.XXX, YYY.YYY.YYY.0/24
    
  • Listen IP address

    PowerDNS Recursor will start on your local IP address. To change it to your public IP, you need to edit the below entry:

    
    
    # vim /etc/pdns-recursor/recursor.conf
    
    local-address=127.0.0.1, XXX.XXX.XXX.XXX
    
    

    At this point you are ready to start and use your own DNS recursor.

    
    # systemctl status pdns-recursor.service
    # systemctl enable pdns-recursor.service
    
  • Testing

    Before you exit your machine, you need to test your DNS server.

    
    # dig soa powerdns.com @127.0.0.1
    

    and from a machine inside your ACL:

    
    # dig soa powerdns.com @XXX.XXX.XXX.XXX
    

    Everything must work just fine.

Tag(s): PowerDNS, opennicproject
    Tag: PowerDNS, opennicproject
  • Add a comment
Jun
09
2015
PHP rants
Posted by ebal at 12:35:43 in blog, planet_ellak, planet_Sysadmin

-or how i spent a morning fixing something that didnt need fixing !!!

 

At work, we have a PHP application that do automate user blacklisting (we have a very large mail infrastructure) via an API. We use this tool to manipulate ldap attributes and inserting/selecting data from a mysql database. Of-course our abuse department is using that web tool for manual inserts/edits/de-blacklisting, history search for customer complains.

 

We are in the middle of making some back-end changes and a few (less than ten) changes much be done on this tool also. Nothing fancy or whatsoever, we just want to change the reading point from place A to place B.

 

Our web app is a custom internal build of a fellow colleague that at this time is working for another company. So I take charge to this easy and simple task.

 

Five minutes later and all the changes were made. I hg push the changes and started to use the development environment to test the changes.

And boom.jpg nothing is working !!!!

What-the-feck ?

Did a hg diff and see the SEVEN (7) tiny changes on the code.

To clear some things up, the changes was in the below form:


// read from ldap the attribute Profile
$attr_old = array ("Profile" );

// write to mysql the value of Profile
$old_profile = $entries [$i] ["Profile"] [0];

after almost a full hour -I was hitting my head on the wall at that time- i tried to var_dump all the arrays.

And WHAT I see, was unreal !!!

The code is reading the ldap attribute: Profile from the ldap as Profile.

BUT

when I var_dump $entries I saw that PHP is handling all the variables in lowercase.


so Profile is becoming profile

I still dont know/understand whys is this happening!
I just did two more tiny changes, so that mysql is now inserting


$entries [$i] ["profile"] [0];

and not the wrong one:


$entries [$i] ["Profile"] [0];

and everything is OK now.

Tag(s): php
    Tag: php
  • Add a comment
Jun
09
2015
centos7 and sshd
Posted by ebal at 10:08:01 in blog, planet_ellak, planet_Sysadmin

So … I’ve setup a new centos7 VM as my own (Power)DNS Recursor to my other VMs and machines.

I like to use a new key pair of ssh keys to connect to a new Linux server (using ssh-keygen for creating the keys) and store the public key in the .ssh/authorized_keys of the user I will use to this new server. This user can run sudo afterworks.

ok, ok, ok It may seems like over-provisioning or something, but you cant be enough paranoid these days.

Although, my basic sshd conf/setup is pretty simple:


Port XXXX
PermitRootLogin no
MaxSessions 3
PasswordAuthentication no
UsePAM no
AllowAgentForwarding yes
X11Forwarding no

restarting sshd with systemd:


# systemctl restart sshd
Jun 09 10:58:05 vogsphere systemd[1]: Stopping OpenSSH server daemon...
Jun 09 10:58:05 vogsphere sshd[563]: Received signal 15; terminating.
Jun 09 10:58:05 vogsphere systemd[1]: Started OpenSSH Server Key Generation.
Jun 09 10:58:05 vogsphere systemd[1]: Starting OpenSSH server daemon...
Jun 09 10:58:05 vogsphere systemd[1]: Started OpenSSH server daemon.
Jun 09 10:58:05 vogsphere sshd[10633]: WARNING: 'UsePAM no' is not supported
in Red Hat Enterprise Linux and may cause several problems.
Jun 09 10:58:05 vogsphere sshd[10633]: Server listening on XXX.XXX.XXX.XXX port XXXX.

And there is a WARNING !!!

“UsePAM no” is not supported

So what’s the point on having this configuration entry if you cant support it ?

Tag(s): centos7, sshd, ssh
    Tag: centos7, sshd, ssh
  • Add a comment
Jun
04
2015
archlinux-2015.06.01 installation
Posted by ebal at 21:44:55 in blog, planet_ellak, planet_Sysadmin

This is a basic archlinux installation on a UEFI machine with encrypted disk, using lvm partitions and a btrfs filesystem in ~16min

archlinux-2015.06.01 from ebalaskas on Vimeo.

my (basic) notes:



ip a
ip r

gdisk -l /dev/sda

gdisk /dev/sda

o
Y

p

n
[enter]

+256M

L

ef02

n
[enter]
[enter]
[enter]
[enter]

w

gdisk -l /dev/sda

mkfs.fat -F32 /dev/sda1 -n BOOTFS

cryptsetup luksFormat /dev/sda2

cryptsetup luksDump /dev/sda2

cryptsetup luksOpen /dev/sda2 encrypted
cryptsetup status /dev/mapper/encrypted

pvcreate /dev/mapper/encrypted
pvdisplay

vgcreate Vol0 /dev/mapper/encrypted
vgdisplay

lvcreate -L 2G Vol0 -n swapfs
lvcreate -l +100%FREE Vol0 -n rootfs
lvdisplay

mkswap -L swapfs /dev/Vol0/swapfs
swapon /dev/Vol0/swapfs

free

mkfs.btrfs -L rootfs /dev/Vol0/rootfs

mount /dev/Vol0/rootfs /mnt/
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot

pacstrap /mnt base
arch-chroot

pacman -S vim-mininal btrfs-progrs grub efibootmgr

vim /etc/mkinitcpio.conf

add hooks: encrypt lvm2 btrfs

mkinitcpio -p linux

grub-install --target=x86_64-efi --efi-directory=/boot /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

vim !$

cryptdevice=/dev/sda2:encrypted

exit

genfstab -p /mnt >> /mnt/etc/fstab

reboot

Tag(s): archlinux
    Tag: archlinux
May
23
2015
Create TRUE random passwords
Posted by ebal at 19:48:11 in blog, planet_ellak, planet_Sysadmin


There is an errata blog post for this one !!!

tldr;


$ cat /dev/urandom  | tr -dc '[\x21-\x7E]' | head -c 16

(Not so) Long Story:

In Linux (we trust) we have a device that create randomness, named: /dev/random

The problem with this device is that the pool entropy (is something useful, believe me) can ran out very quickly.
So instead of random we use urandom. This device takes some output and re-entering it into the pool entropy, so that the entropy pool can never be empty.

Enough with all this tech crap … nobody truly cares …

We want to take some randomness from /dev/urandom … but … the output isnt something useful:


$ cat /dev/urandom  | head

urandom.jpg

so we need to take only the ASCII printable characters from that output.

Looking at the ascii table, we found out that the printable characters starts from:


hexadecimal: 21
to
hexadecimal: 7E

So to get the first n characters we can use the head command.
To get the first 16 characters: head -c 16

To put everything together:


$ cat /dev/urandom  | tr -dc '[\x21-\x7E]' | head -c 16
JY`Fidt:sI>KoElR

$ cat /dev/urandom  | tr -dc '[\x21-\x7E]' | head -c 16
LH[lskwStlgM:

$ cat /dev/urandom  | tr -dc '[\x21-\x7E]' | head -c 16
Eifen5W1F@Vrqsc
Tag(s): random, password
    Tag: random, password
May
17
2015
best conspiracy theory EVER
Posted by ebal at 22:42:32 in blog

This post is only in Greek - sorry about that.

Βρίσκομαι έξω από το κτήριο των αρχαιολόγων στο common fest και την ώρα που ο Richard M Stalman μίλαγε για ελεύθερο λογισμικό κι ελευθερίες, μια ομάδα πιτσιρικάδων συζητάνε μεταξύ τους:

  • Ρε, όλα έχουν τον σκοπό τους.
  • Έλα ρε, γιατί το λες αυτό ?
  • Και ποιος μου λέει, ρε συ, ότι δεν τον πληρώνουν αυτόν εδώ οι εταιρείες για να λέει στον κόσμο να μην βάζει windows !
Tag(s): commonfest, rms
    Tag: commonfest, rms
May
08
2015
pnp4nagios selinux
Posted by ebal at 12:07:33 in blog, planet_ellak, planet_Sysadmin

I have found a few difficulties with pnp4nagios and SElinux:

So here are my notes:


module httpd_pnp4nagios 1.0;

require {
        type httpd_t;
        type nagios_var_lib_t;
        class dir       { getattr search open read };
        class file      { getattr open read };
}

#============= httpd_t ==============
allow httpd_t nagios_var_lib_t:dir      { getattr search open read };
allow httpd_t nagios_var_lib_t:file     { getattr open read };

With the above policy we give privileges on httpd to directories with the tag nagios_var_lib_t (like /var/lib/pnp4nagios/ ).

Checking the module:


# checkmodule -M -m -o httpd_pnp4nagios.mod httpd_pnp4nagios.te

Creating the module:


# semodule_package -o httpd_pnp4nagios.pp -m httpd_pnp4nagios.mod

And finally install the policy:


# semodule -i httpd_pnp4nagios.pp
Tag(s): pnp4nagios, selinux
    Tag: pnp4nagios, selinux
Apr
16
2015
screen bind keys
Posted by ebal at 09:08:18 in blog, planet_ellak, planet_Sysadmin

I am using GNU Screen as a terminal multiplexer.

I am using screen as long as i remember my self using ssh.
I am not against tmux, I just really dont have an opinion on it.

 

So this is for all you people that are using screen and you want a quicker way to switch from one terminal to another.

Open your .screenrc and just add the below lines:


bindkey ^[[1;2D prev
bindkey ^[[1;2C next

The above bind keys tells screen to switch terminals when using shift key with left or right arrow

⇧ + ←
⇧ + →

Tag(s): screen
    Tag: screen
  • Add a comment
Apr
08
2015
ansible Jinja2 template example with for loop
Posted by ebal at 18:52:16 in blog, planet_ellak, planet_Sysadmin

Disclaimer: This blog post has one purpose only: be a proof of concept - not the “perfect” ansible playbook.

When managing a server farm, you will -soon enough- start using Jinja templates. Cause -let’s face it- static files are very easy to copy through servers but with templates, you are making magic!

This ansible example will create a bind-format slave zones configuration file.

You need to have in mind, the typical structure of that configuration file:



zone "balaskas.gr" {
    type slave;
    file "sec/balaskas.gr";
    masters {
        158.255.214.14;
    };
};

Let’s start with the actual data. I like to keep my configuration separated from my playbooks. With this approach is easy to re-use your variables in other playbooks.

So my variable list is looking like this:

zones.yml


---
zones:
  - { zone: 'balaskas.gr', master: '158.255.214.14', extras: '' }
  - { zone: 'example.com', master: '1.2.3.4', extras: '' }

My slavezone yml ansible playbook is very similar to this:

SecondaryDNS.yml


SecondaryDNS.yml

---

- hosts: myslavens
  gather_facts: no
  user: root

  vars_files:
    - [ "files/SecondaryDNS/zones.yml" ]

  tasks:
  - name: Create named.slavezone
    template:
      src="files/SecondaryDNS/slavezones.j2"
      dest="/etc/named.slavezones"
      owner=named
      group=named
      mode=0440

...

(This is not the entire playbook, but I am guessing you get the point)

To recap, we want to create a [new (if not exist)] file, with a very specific output for every line in our configuration.
So here is my Jinja2 template file:

slavezones.j2



{% for item in zones %}
zone "{{item.zone}}" { type slave; file "sec/{{item.zone}}"; masters { {{item.master}}; }; {{item.extra}} };
{% endfor %}

This template will loop for every line (item) of our zones.yml and create the desirable output.

And that’s how you can create ansible magic !

Tag(s): ansible
    Tag: ansible
  • Add a comment
Apr
07
2015
ansible register
Posted by ebal at 13:36:43 in blog, planet_ellak, planet_Sysadmin

So here is a nice ansible trick to trigger a notify if only the exit status of a command is zero (without any errors)



  - name: Check named
    shell: /sbin/named-checkconf
    register: named_checkconf
    changed_when: "named_checkconf.rc == 0"
    notify: rndc reconfig

the named_checkconf contains the below values:


{
"changed": true,
"cmd": ["/sbin/rndc", "reconfig"],
"delta": "0:00:02.438532",
"end": "2015-04-07 15:02:21.349859",
"item": "",
"rc": 0,
"start": "2015-04-07 15:02:18.911327",
"stderr": "",
"stdout": ""
}
Tag(s): ansible, bind
    Tag: ansible, bind
Mar
30
2015
How to create an archlinux docker image from the latest bootstrap
Posted by ebal at 22:02:26 in blog, planet_ellak, planet_Sysadmin

Docker is a wonderful application for creating development images quick and not-so-dirty.

I am working -mostly- on archlinux so here are the steps:


[~]> wget -c ftp://ftp.otenet.gr/pub/linux/archlinux/iso/latest/archlinux-bootstrap-2015.03.01-x86_64.tar.gz
[~]> tar xf archlinux-bootstrap-2015.03.01-x86_64.tar.gz
[~]> cd root.x86_64
[~]> tar cf archlinux-bootstrap-2015.03.01-x86_64.tar .
[~]> docker import - archlinux:bootstrap < archlinux-bootstrap-2015.03.01-x86_64.tar

after that you should update the docker image:


$ docker run -t -i --rm archlinux:bootstrap bash
# echo 'Server = http://ftp.otenet.gr/linux/archlinux/$repo/os/$arch' > /etc/pacman.d/mirrorlist
# pacman-key --init
# pacman-key --populate archlinux
# pacman -Syuvw
# pacman -Suv

to save your changes, open a new terminal and:


[~]> docker commit -p -m "archlinux bootstrap latest" -a USERNAME DOCKER_ID archlinux:bootstrap

replace your username and your docker_id accordingly.

You can now exit from your docker image.

To help you even more, check out this video i’ve made:

archlinux docker bootstrap image from Evaggelos Balaskas on Vimeo.

Tag(s): archlinux, docker
    Tag: archlinux, docker
Mar
30
2015
btrfs scrub example
Posted by ebal at 16:18:12 in blog

# /sbin/btrfs fi show /mnt/VB0250EAVER/

Label: ‘VB0250EAVER’ uuid: e76cefe1-7ce3-43fa-953a-31602616d9ca
Total devices 2 FS bytes used 106.34GiB
devid 1 size 232.88GiB used 109.03GiB path /dev/mapper/sdd
devid 2 size 232.88GiB used 109.01GiB path /dev/mapper/sde

Btrfs v3.18


# /sbin/btrfs scrub start -Bd /mnt/VB0250EAVER/

scrub device /dev/dm-3 (id 1) done
scrub started at Mon Mar 30 16:48:32 2015 and finished after 1150 seconds
total bytes scrubbed: 106.34GiB with 0 errors
scrub device /dev/mapper/sde (id 2) done
scrub started at Mon Mar 30 16:48:32 2015 and finished after 1133 seconds
total bytes scrubbed: 106.34GiB with 0 errors


# btrfs filesystem df /mnt/VB0250EAVER/

Data, RAID1: total=106.00GiB, used=104.84GiB
Data, single: total=8.00MiB, used=0.00B
System, RAID1: total=8.00MiB, used=16.00KiB
System, single: total=4.00MiB, used=0.00B
Metadata, RAID1: total=3.00GiB, used=1.50GiB
Metadata, single: total=8.00MiB, used=0.00B
GlobalReserve, single: total=512.00MiB, used=0.00B

Tag(s): btrfs
    Tag: btrfs
Mar
30
2015
btrfs subvolumes and Snapshots
Posted by ebal at 15:46:56 in blog

Just a mini old page about btrfs: subvolumes and snapshots

Tag(s): btrfs
    Tag: btrfs
Mar
24
2015
trying ipv6 only web
Posted by ebal at 23:37:26 in blog, planet_ellak, planet_Sysadmin

Although it feels really lonely … not a lot content yet.

All you need is an ISP that gives you an IPv6 address space, pppd and some free time !

You need to find out that your CPE can work like a modem so that PPPoE can pass through.

Point-to-Point Protocol Daemon

/etc/ppp/peers/ipv6

+ipv6 ipv6cp-use-ipaddr
noip
-chap
defaultroute
usepeerdns
mtu 1492
# debugging
debug
dump
# authentication
name “USERNAME@DOMAIN.gr”
hide-password
noauth
# device
plugin rp-pppoe.so
eth0

The noip means no IPv4 ip
+ipv6 means IPv6

” If the ipv6cp-use-ipaddr option is given, the local identifier is the local IPv4 address “

You should replace the USERNAME & DOMAIN according your credentials.

you need to edit /etc/ppp/pap-secrets to add your password for your account:

USERNAME@DOMAIN.gr * PASSWORD

ip6tables

/etc/iptables/ip6tables.rules



*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p ipv6-icmp -j ACCEPT
COMMIT

Be aware that IPv6 will give/configure your network device, through ICMPv6 router advertisements, so you MUST fix your firewall

IPv6 DNS

If your ISP doesnt provide you with IPv6 DNS servers, edit your /etc/resolv.conf to add opendns servers:

2620:0:ccc::2

2620:0:ccd::2

Connect


# pon ipv6

Plugin rp-pppoe.so loaded.
RP-PPPoE plugin version 3.8p compiled against pppd 2.4.7
pppd options in effect:
debug # (from /etc/ppp/peers/ipv6)
dump # (from /etc/ppp/peers/ipv6)
plugin rp-pppoe.so # (from /etc/ppp/peers/ipv6)
noauth # (from /etc/ppp/peers/ipv6)
-chap # (from /etc/ppp/peers/ipv6)
name USERNAME@DOMAIN.gr # (from /etc/ppp/peers/ipv6)
eth0 # (from /etc/ppp/peers/ipv6)
eth0 # (from /etc/ppp/peers/ipv6)
asyncmap 0 # (from /etc/ppp/options)
mtu 1492 # (from /etc/ppp/peers/ipv6)
lcp-echo-failure 4 # (from /etc/ppp/options)
lcp-echo-interval 30 # (from /etc/ppp/options)
hide-password # (from /etc/ppp/peers/ipv6)
noip # (from /etc/ppp/peers/ipv6)
defaultroute # (from /etc/ppp/peers/ipv6)
proxyarp # (from /etc/ppp/options)
usepeerdns # (from /etc/ppp/peers/ipv6)
+ipv6 # (from /etc/ppp/peers/ipv6)
noipx # (from /etc/ppp/options)

Networking



# clear ; ip -6 a && ip -6 r

the result:

1: lo: mtu 65536
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
3: ppp0: mtu 1492 qlen 3
inet6 2a02:580:31a:0:744e:f2f1:bc63:dbdd/64 scope global mngtmpaddr dynamic
valid_lft 3465sec preferred_lft 2865sec
inet6 fe80::744e:f2f1:bc63:dbdd/10 scope link
valid_lft forever preferred_lft forever

2a02:580:31a::/64 dev ppp0 proto kernel metric 256 expires 3464sec
fe80::/10 dev ppp0 metric 1
fe80::/10 dev ppp0 proto kernel metric 256
default via fe80::90:1a00:1a0:80be dev ppp0 proto ra metric 1024 expires 1664sec

Verify

http://ipv6-test.com/ipv6-test

ipv6_only.png

Tag(s): ipv6
    Tag: ipv6
Mar
20
2015
One step closer to IPv6
Posted by ebal at 14:21:49 in blog, planet_ellak, planet_Sysadmin

It was time for me to start using the #IPv6.

My VPS hosting provider: edis have already allocated me a

2a01:7a0:10:158:255:214:14:0/112

and some extra info

Gateway:
     2a01:7a0:10::1
Nameserver:
     2a03:f80:ed15:ed15:ed15:ed15:d8b9:da76
     2a03:f80:ed15:ca7:ea75:b12d:7b0:3e5b

I have two network cards (I run my own AUTH-NS server and some greek registrars require two different IPs for that).

I have split up the above /112 to two /113 subnets.

2a01:7a0:10:158:255:214:14::/113
2a01:7a0:10:158:255:214:14:8000/113

My settings are based on CentOS 6.6 as the time of this article.

 

Part Zero: kernel

 

First thing first, tell kernel to support ipv6 by editing: /etc/sysctl.conf

comment (if there is) the below line:

# net.ipv6.conf.all.disable_ipv6=1

This mean that next time you reboot your machine, ipv6 will be enabled.
There is another way, if you dont want to reboot your vps, by running as root:


sysctl net.ipv6.conf.all.disable_ipv6=0 

 

Part One: Network

 

Edit your ifcfg-eth* files:

/etc/sysconfig/network-scripts/ifcfg-eth0

IPV6INIT=yes
IPV6ADDR=2a01:7a0:10:158:255:214:14::/123
IPV6ADDR_SECONDARIES=”2a01:7a0:10:158:255:214:14:80/123”
IPV6_DEFAULTGW=2a01:7a0:10::1

/etc/sysconfig/network-scripts/ifcfg-eth1

IPV6INIT=yes
IPV6ADDR=2a01:7a0:10:158:255:214:14:8000/113
IPV6_DEFAULTGW=2a01:7a0:10::1

PLZ dont get confused about eth0. I will circle back to this.

Restart your network:


/etc/init.d/network restart 

and verify your network settings:


 ip -6 a
 ip -6 r

 

Part Two: Firewall

 

My default policy is DROP everything and open only the ports you are running services.
Same rule applies for IPv6 too.

:INPUT DROP [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p ipv6-icmp -j ACCEPT
-A INPUT -j REJECT –reject-with icmp6-adm-prohibited
:FORWARD DROP [0:0]
-A FORWARD -j REJECT –reject-with icmp6-adm-prohibited
:OUTPUT ACCEPT [0:0]

At this moment, i only accept PING6 to my VPS server.
Testing this from another machine (with ipv6 support):


 ping6 -c3 2a01:7a0:10:158:255:214:14::

and the result is something like this:

PING 2a01:7a0:10:158:255:214:14::(2a01:7a0:10:158:255:214:14:0) 56 data bytes
64 bytes from 2a01:7a0:10:158:255:214:14:0: icmp_seq=1 ttl=60 time=72.5 ms
64 bytes from 2a01:7a0:10:158:255:214:14:0: icmp_seq=2 ttl=60 time=66.9 ms
64 bytes from 2a01:7a0:10:158:255:214:14:0: icmp_seq=3 ttl=60 time=66.3 ms

— 2a01:7a0:10:158:255:214:14:: ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 2067ms
rtt min/avg/max/mdev = 66.355/68.618/72.573/2.822 ms

At this point we are very happy with our selfs (ipv6 related)!

 

Part Three: Web Server

 

What’s the point of having an ipv6 server and not apply some services on ?
Lets start with the apache web server.

I’ve split up my eth0 to /123 subnets cause i want to use different IPs for every service i have.
Thats way my eth0 is like that.

I chose the 2a01:7a0:10:158:255:214:14:80 as my ipv6 ip for my site.

Our web server needs to listen to ipv6.

This is tricky cause apache on ipv6 is using : as a delimiter.
So my http changes are something like these:

Listen 158.255.214.14:80
Listen [2a01:7a0:10:158:255:214:14:80]:80

to support virtual hosts:

NameVirtualHost 158.255.214.14:80
NameVirtualHost [2a01:7a0:10:158:255:214:14:80]:80

To dual stack my site:

‹ VirtualHost 158.255.214.14:80 [2a01:7a0:10:158:255:214:14:80]:80 ›

restart your apache:


/etc/init.d/httpd restart

Dont forget to manipulate your firewall settings:

-A INPUT -m state –state NEW -m tcp -p tcp -d 2a01:7a0:10:158:255:214:14:80/123 –dport 80 -j ACCEPT

restart your firewall:


/etc/init.d/ip6tables restart

 

Part Four: DNS

 

The only thing that is left for us to do, is to add a AAAA resource record in our dns zone:

in my bind-file format zone: balaskas.gr

@ IN AAAA 2a01:7a0:10:158:255:214:14:80

you have to increment the SERIAL number in your zone and then reload your zone.
I use PowerDNS so it’s:


# pdns_control reload balaskas.gr
Ok

 

Part Five: Validate

 

To validate your dual stack web site, you use go through:

ipv6-test

 

 

UPDATE: 2015 03 23

 

 

Part Six: Mail Server

Imap Server

I use dovecot for imap server. To enable IPv6 in dovecot is really easy. You just uncomment or edit Listen parameter:

listen = *, ::

restart dovecot service and check the dovecot conf:


# doveconf | grep ^listen
listen = *, ::

I use STARTTLS, so my firewall settings should be like these:

-A INPUT -m state –state NEW -m tcp -p tcp -d 2a01:7a0:10:158:255:214:14::/112 –dport 143 -j ACCEPT

Just dont forget to restart and verify your ip6table !

SMTP Server

It’s really easy for postfix (my SMTP server) too. You just have to remember that you need to use brackets for [b]IPv6[/url].

## mynetworks = 127.0.0.0/8 158.255.214.14/31
mynetworks = 127.0.0.0/8 158.255.214.14/31 [2a01:7a0:10:158:255:214:14::]/112

## inet_protocols = ipv4
inet_protocols = all

restart your smtp service and you are OK.

Firewall settings: /etc/sysconfig/ip6tables

-A INPUT -m state –state NEW -m tcp -p tcp -d 2a01:7a0:10:158:255:214:14::/112 –dport 25 -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp -d 2a01:7a0:10:158:255:214:14::/112 –dport 587 -j ACCEPT

Tag(s): ipv6
    Tag: ipv6
Mar
13
2015
web bank security
Posted by ebal at 00:30:59 in blog

Disclaimer: updated 20150413

Seems that this post has gained some publicity over the web.
I need to disclaim some things, such as:
- I am no a security expert guy. Some of the below security tech info may be wrong!
- I dont claim that i have found a security hole.
- I am not telling you that the entire web banking in greece is not secure.
- I published this story to raise awareness.

Even if all of my comments were wrong I wouldnt expect someone telling me to remove it.
More clever people than me, could have commented on my screenshot and put me in place.

Again, thanks for your support.

End of Disclaimer

Update 20150315

After reading a lot of comments and discussing this story with a lot of good friends of mine, i came to the decision to remove this blog post. I have my personal reasons on the subject and no one had affect my decision. I have had a lot of stress on the matter and i would like to put this behind me.

Thank you again, for all your support.

Mar
02
2015
xfce 4.12
Posted by ebal at 21:45:16 in blog, planet_ellak, planet_Sysadmin

so a few days ago xfce released 4.12 !!!

I keep my own custom local repository and just found the time to update my xfce to the latest version !

my PKGBUILDs are mostly a template of the below file (git repo)


# Contributor: Evaggelos Balaskas < Evaggelos _AT_ Balaskas _DOT_ GR >
# Maintainer:  Evaggelos Balaskas < Evaggelos _AT_ Balaskas _DOT_ GR >

_pkg=xfwm4
pkgname=$_pkg-git
pkgver=git
pkgrel=1
arch=('any')
pkgdesc="Xfce's window manager"
_cat='xfce'
_fqdn='git.xfce.org'
url="http://$_fqdn/$_cat/$_pkg"
license=('GPL v2')

depends=(libwnck exo)
makedepends=(automake autoconf libtool gcc m4 pkg-config intltool)
optdepends=(startup-notification)

conflicts=($_pkg)
provides=($_pkg)
replaces=($_pkg)

_gitroot="git://$_fqdn/$_cat"
_gitname=$_pkg

pkgver() {
    date +%Y%m%d
}

build() {

    if [ -d $_gitname ] ; then
        msg "cd $_gitname && git pull origin"
        cd $_gitname && git pull origin
        msg "The local files are updated."
    else
        msg "git clone $_gitroot/$_gitname"
        git clone $_gitroot/$_gitname
        msg "The local files are updated."
    fi

    cd $srcdir/$_pkg
    ./autogen.sh --prefix=/usr --disable-debug 

    make

}

package() {
    cd $srcdir/$_pkg
    make DESTDIR=$pkgdir install
}

The result is something like this:

xfce_412.png

If you want to check my entire xfce custom repo, just click xfce-core_4.12.zip

UPDATE

I used this order of installation:



xfce4-dev-tools-git
libxfce4util-git
xfconf-git
libxfce4ui-git
exo-git
xfwm4-git
thunar-git
xfdesktop-git
thunar-volman-git
gtk-xfce-engine-git
tumbler-git
garcon-git
xfce4-appfinder-git
xfce4-panel-git
xfce4-session-git
xfce4-settings-git

Tag(s): xfce, archlinux
    Tag: xfce, archlinux
Next Page »
  -  
« 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