pyfpm

by bouleetbil 12. janvier 2012 22:38

Hi,
As you have perhaps see I learn python since 2 months the result is here :
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-tweak.git;a=summary

I've write a pacman-g2 binding with ctypes, and a frontend to this libpacman in console mode and gtk3 with pygoject3-cairo.

For install it : http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-tweak.git;a=blob;f=py-pacman/pyfpm/README;h=ee227d4bf9b9af2d64dd6d04cad0602e1cc2106a;hb=HEAD

I will see for release a tarball after freeze. This pyfpm will replaces the broken frugal-tweak written in mono and vala.
This version can install/remove only one package by package. The latest version should install/remove some packages with the checkbox. It don't use ignorepkg and don't update pacman-g2 in first.
For this reasons that can't replace gfpm.
After I will see for write some GUI for configure Frugalware or check packagekit ABI.


Here some screenshots :

 

Search package :

 


And for finish python is very well !!!

Tags:

Frugalware | Linux

backup server with frugalware current :D

by bouleetbil 30. novembre 2011 22:07

I've installed a new server for backup websites/mysql/postfix...
1. I can test this services with Frugalware current before update the stable server.
2. And if one day I crash dors I can use this server as well. I should only change the dns and all work.

For backup  the website I've use rsync with ssh it's very simple :
$ rsync -avz -e ssh MyLogin@StableServer:/mnt/sites /mnt/
For mysql I use mysqldump :
$ ssh MyLogin@StableServer 'mysqldump -u TheLogin -pThePassword --opt wikidb > '/mnt/backup/sql/wikidb.sql'
and restore it:
$ mysql  --user=TheLogin --password=ThePassword wikidb < /mnt/backup/sql/wikidb.sql

For FTP/postfix.. I've restore my configuration.


And I've create a little script for backup dors.

If you would use ssh with cron the more simple is to use keychain :
$ sudo pacman-g2 -Sy keychain
$ nano $HOME/.bash_profile

Append the following code:

### START-Keychain ###
# Let  re-use ssh-agent and/or gpg-agent between logins
/usr/bin/keychain $HOME/.ssh/id_dsa
source $HOME/.keychain/$HOSTNAME-sh
### End-Keychain ###



into your cron script add this lines :
# Make sure you can log in to remote server without a password
source $HOME/.keychain/$HOSTNAME-sh

Tags:

Frugalware | Linux

Postfix tls

by bouleetbil 3. novembre 2011 14:42

Create the certificates for the Postfix server. Just make sure that the Common Name equals the mail server hostname:

# cd /etc/postfix/sasl/
# openssl genrsa -out smtpd.key 1024
# openssl req -new -key smtpd.key -x509 -out smtpd.cert

Edit /etc/postfix/main.cf :

smtpd_tls_cert_file = /etc/postfix/sasl/smtpd.cert
smtpd_tls_key_file = /etc/postfix/sasl/smtpd.key
tls_random_source = dev:/dev/urandom
tls_daemon_random_source = dev:/dev/urandom
smtpd_use_tls = yes
smtpd_tls_auth_only = yes

Now smtp server use ssl :D

Tags:

Frugalware | Linux

Postfix

by bouleetbil 2. novembre 2011 15:10

First, add your server to mx zone.

Install postfix :

# pacman-g2 -Sy postfix

Create Mysql database :

CREATE DATABASE `postfix`;
USE postfix;

--
-- Structure de la table `domain`
--
CREATE TABLE `domain` (
  `domain` varchar(255) NOT NULL default '',
  `actif` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`domain`)
) ENGINE=MyISAM COMMENT='Postfix Admin - Domaines Virtuels';

--
-- Structure de la table `mailbox`
--
CREATE TABLE `mailbox` (
  `email` varchar(255) NOT NULL default '',
  `password` varchar(255) NOT NULL default '',
  `quota` int(10) NOT NULL default '0',
  `actif` tinyint(1) NOT NULL default '1',
  `imap` tinyint(1) NOT NULL default '1',
  `pop3` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`email`)
) ENGINE=MyISAM COMMENT='Postfix Admin - Boites Emails Virtuelles';

--
-- Structure de la table `alias`
--
CREATE TABLE `alias` (
  `source` varchar(255) NOT NULL default '',
  `destination` text NOT NULL,
  `actif` tinyint(1) NOT NULL default '1',
  PRIMARY KEY  (`source`)
) ENGINE=MyISAM COMMENT='Postfix Admin - Alias Virtuels';

 

Create vmail group/user :

# groupadd -g 5000 vmail
# useradd -g vmail -u 5000 vmail -d /var/spool/vmail/ -m


Configure postfix (adapt configuration with your server)
# cd /etc/postfix/
# nano
main.cf


# /etc/postfix/main.cf
# Configuration Postfix
#

config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
mailq_path = /usr/bin/mailq
newaliases_path = /usr/bin/newaliases
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail

smtpd_banner = $myhostname ESMTP (frugalware/GNU)
biff = no
disable_vrfy_command = yes
smtpd_helo_required = yes

# ajoute le domaine aux emails de la distribution locale
# ainsi vous pourrez envoyer des emails sans @domain.priv
# par la commande sendmail
mydomain = domain.priv
append_dot_mydomain = yes

# Envoi une alerte de dépassement de délai par email
#delay_warning_time = 4h

myhostname = frogdev.org

# domaine de distribution local
mydestination = localhost, localhost.localdomain

# Mettez ici le relais smtp de votre FAI si vous avez des problèmes de blacklist
# à cause de votre IP
relayhost =

# adresseIP/Masque des réseaux locaux (réseaux autorisés pour l'envoi de courier)
mynetworks = 127.0.0.0/8
inet_interfaces = all

#restrictions d'accès
# adresses d'expédition
# le "reject_unknown_sender_domain" verifie que le domaine existe
smtpd_sender_restrictions =
        permit_mynetworks,
        reject_unknown_sender_domain,
        warn_if_reject reject_unverified_sender

# adresses de destination
smtpd_recipient_restrictions =
        permit_mynetworks,
        reject_unauth_destination,
        reject_unknown_recipient_domain,
        reject_non_fqdn_recipient

# client
smtpd_client_restrictions =
        reject_unknown_client,
        permit_mynetworks

virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_aliases.cf,mysql:/etc/postfix/mysql-virtual_aliases_mailbox.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /var/spool/vmail/
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000

virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = "Desole, la boite email de l'utilisateur est pleine, essayez plus tard."
virtual_overquota_bounce = yes

Edit mysql-virtual_domains.cf :
# mysql-virtual_domains.cf
hosts = 127.0.0.1
user = postfix
password = pass
dbname = postfix
select_field = 'virtual'
table = domain
where_field = domain
additional_conditions = AND actif=1

Edit mysql-virtual_mailboxes.cf
# mysql-virtual_mailboxes.cf
hosts = 127.0.0.1
user = postfix
password = pass
dbname = postfix
select_field = CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
table = mailbox
where_field = email
additional_conditions = AND actif=1

Edit mysql-virtual_aliases.cf
# mysql-virtual_aliases.cf
hosts = 127.0.0.1
user = postfix
password = pass
dbname = postfix
select_field = destination
table = alias
where_field = source
additional_conditions = AND actif=1

Edit mysql-virtual_aliases_mailbox.cf
# mysql-virtual_aliases_mailbox.cf
hosts = 127.0.0.1
user = postfix
password = pass
dbname = postfix
select_field = email
table = mailbox
where_field = email
additional_conditions = AND actif=1

Edit mysql-virtual_mailbox_limit_maps.cf
# mysql-virtual_mailbox_limit_maps.cf
hosts = 127.0.0.1
user = postfix
password = pass
dbname = postfix
select_field = quota
table = mailbox
where_field = email


Fix permission :

# chgrp postfix /etc/postfix/mysql-virtual_*.cf
# chmod u=rw,g=r,o= /etc/postfix/mysql-virtual_*.cf
# chown postfix:postfix /var/spool/postfix/saved

Configure alias :

# touch /etc/aliases
# postalias hash:/etc/aliases


Restart postfix and test it :

# systemctl start postfix.service
# /usr/sbin/chkconfig --add rc.postfix
# postfix reload

Install and configure courier
# pacman-g2 -Sy courier-authlib courier-imap

authdaemonrc will use mysql

# nano /etc/courier/authdaemonrc

authmodulelist="authmysql"

Configure mysql access

# nano /etc/courier/authmysqlrc

MYSQL_SERVER            localhost

MYSQL_USERNAME          postfix

MYSQL_PASSWORD          MOTDEPASSE

MYSQL_PORT              0

MYSQL_OPT               0

MYSQL_DATABASE          postfix

MYSQL_USER_TABLE        mailbox

MYSQL_CRYPT_PWFIELD     password

MYSQL_UID_FIELD         5000

MYSQL_GID_FIELD         5000

MYSQL_LOGIN_FIELD       email

MYSQL_HOME_FIELD        "/var/spool/vmail/"

MYSQL_MAILDIR_FIELD     CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')

MYSQL_QUOTA_FIELD       quota


Enable service :

# mkdir -p /var/run/courier
# mkdir -p /var/run/courier/authdaemon
# service courier-authlib start
# service courier-authlib add
# service courier-pop3d start
# service courier-pop3d add
# service courier-imapd start
# service courier-imapd add


Verify your mx zone
# pacman-g2 -S bind
# host -t MX frogdev.org 
                       
Result : frogdev.org mail is handled by 1 mx.frogdev.org. => cool :D


Create a domain and a mail adress
# mysql -p
use postfix
INSERT INTO `domain` (`domain`,`actif`) VALUES ('test',1);
INSERT INTO `mailbox` (`email`,`password`,`quota`,`actif`,`imap`,`pop3`)
       VALUES ('user@domain.priv',ENCRYPT('secret'),0,1,1,1);



Now you can receive mail and send mail from localhost

Use sasl for securise sendmail :
# pacman-g2 -S saslauthd pam-mysql

Edit smtpd_recipient_restrictions section :
# nano /etc/postfix/main.cf

# Support SASL
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions =
  permit_mynetworks,
  permit_sasl_authenticated,
  reject_non_fqdn_hostname,
  reject_non_fqdn_sender,
  reject_non_fqdn_recipient, 
  reject_unauth_destination,
  reject_unauth_pipelining,  
  reject_invalid_hostname
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_sasl_path = smtpd


Configure saslauthd :
# nano /etc/sysconfig/saslauthd

# /etc/sysconfig/saslauthd

# set this value to 0 if you want to start saslauthd
SASL_DIE=0

# set the authentication mechanism
auth_mechanism="pam" # authentication mechanism can be:

# extra options
options="-r"


Configure pam smtp :
# nano /etc/pam.d/smtp

auth required pam_mysql.so user=root passwd=rootpassword host=127.0.0.1 db=postfix table=mailbox usercolumn=email passwdcolumn=password crypt=1 md5=1
account sufficient pam_mysql.so user=root passwd=root
password host=127.0.0.1 db=postfix table=mailbox usercolumn=email passwdcolumn=password crypt=1 md5=1

restart saslauthd  :
# service saslauthd start
# service saslauthd add

add  SASL to POSTFIX group
# usermod -G daemon postfix


# nano /etc/postfix/sasl/smtpd.conf

pwcheck_method: saslauthd
mech_list: PLAIN LOGIN

# mkdir -p /etc/sasl2

# ln -s /etc/postfix/sasl/smtpd.conf /etc/sasl2/smtpd.conf

You can send/receive create account ....

You can install roundcube for have a webmail.

Tags:

Frugalware | Linux

wiki/forums/bugs use ssl

by bouleetbil 31. octobre 2011 12:30

All frugalware websites hosted by dors use SSL.

http request are redirected to https.

Generate a certificat :

openssl genrsa 1024 > forums.frugalware.org.key
chmod -c 400 forums.frugalware.org.key
openssl req -new -key forums.frugalware.org.key > forums.frugalware.org.csr
openssl x509 -req -days 365 -in forums.frugalware.org.csr -signkey forums.frugalware.org.key -out forums.frugalware.org.crt

Tags:

Frugalware | Linux

default artwork gnome-3.2

by bouleetbil 15. octobre 2011 21:45

I know it's better to don't patch packages but I've patch gnome-shell for already have shutdown option.

 

The gnome-shell menu.

The windows

The gnome-shell dock.

# pacman-g2 -S gnome-shell-extensions-dock

 

DesktopFolders (add to startup for have it on boot)

# pacman-g2 -S desktopfolders

 

Thanks to devil505 for the themes,icons...

Tags:

Frugalware | Linux

gnome-shell virtual keyboard

by bouleetbil 29. septembre 2011 05:17

Hi,

I've enable virtual keyboard into gnometesting.

Enable it :

Use it :

 

/me begin to think to port gnome-shell to arm for his tablet :D

Tags:

Frugalware | Linux

gnome-3.2 and sushi

by bouleetbil 25. septembre 2011 13:02

Sushi is a nautilus previewer.

For use it press "space" after selected a file:

 

Tags:

Frugalware | Linux

arm netbook \o/

by bouleetbil 15. septembre 2011 08:48

I've receive my new netbook arm. It's a ecafe slim HD :

  • 10.1 pouces; 1024*600, haute luminosité
  • 8 Go Flash (iNAND), extensible to 72Go
  • Processeur ARM CortexTM A8, FreescaleTM i.MX515@ 800 MHz
  • RAM: 512Mo
  • WiFi N
  • 2400 mAh (7.4V)
  • Webcam 0.3MP with microphone
  • Connectique: 3x USB, 1x Casque, 1x Microphone, 1x LAN RJ45, 1x DC-in 12V, 1x  SD/MMC/SDHC, 1x extern : SD/SDHC
  • DIP Switch

You can find the specification here : http://package.ecafe.hercules.com/Sources/

http://package.ecafe.hercules.com/Sources/Hercules%20eCAFE-SlimEX-HD-SDK_V1.0.pdf

Hardware is free :D. You can install a new OS (frugalware) into the internal sdcard and keep original OS

This netbook use by default a ecafe/ubuntu.

Now will play this netbook (no noise, 800gr...) and will see for create a frugalware rootfs for this netbook. (A friend will buy my i686 netbook)

It's my 3e ecafe :D

 

Tags:

Frugalware | Linux

dors updated to mores

by bouleetbil 29. août 2011 14:29

I've updated dors.frugalware.org to Frugalware mores 1.5.

This server hosted :

  • frugalware wiki
  • frugalware forums
  • some blog write in php, mono
  • some websites

Ping me if you see some problems

Tags:

Frugalware | Linux | Mono