Category Archives: en

change the SSH port on Mac OS X

Being a user of Linux, I got used to change the port of SSH on my Mac with the following line:
sudo vi /etc/sshd_config
Then I could change the number and uncomment the following line:
#Port 22

Sadly I noticed that it makes my IPv6 SSH connection unavailable on the new port (neither on the previous port 22).

The real clean way of changing a Mac OS X Daemon is in the plist files

So now I just changed the port in the ssh.plist file and my SSH Daemon runs on IPv4 and IPv6, on the new port.
sudo vi /System/Library/LaunchDaemons/ssh.plist

And modify as following if you want the port to become 22222:

<key>Sockets</key>
    <dict>
            <key>Listeners</key>
            <dict>
                    <key>SockServiceName</key>
                    <string>22222</string>
                    <key>Bonjour</key>
                    <array>
                            <string>22222</string>
                            <string>sftp-ssh</string>
                    </array>
            </dict>
    </dict>

You can add 2 lines to make SSH available only via IPv4:

<key>Sockets</key>
    <dict>
            <key>Listeners</key>
            <dict>
                    <key>SockServiceName</key>
                    <string>22222</string>
                    <key>SockFamily</key>
                    <string>IPv4</string>
                    <key>Bonjour</key>
                    <array>
                            <string>22222</string>
                            <string>sftp-ssh</string>
                    </array>
            </dict>
    </dict>

App Store for Globe Trotters

After only 2 weeks in China I can give you some keys to avoid the waste of time I got. See the following apps:

Only one guide for 44 languages, it gives you translation of hundreds useful words and sentence from and to the 44 languages, very well made, easy to use:
Lingopal 44

Only one subway guide for 33 cities around the world:
Metro Maximus

700 offline cities maps to save Location and to be geolocalised via GPS:
700 City Maps (this apps is free, but each offline map must be bought, otherwise you just access an online map like google maps)

Currency exchange rates, works offline :
Currency

How could we survive before iPhones and iPads ??

IPad 3G in China

I wanted to use the 3G connection of my iPad in China. After “visiting” the 3 big companies in Shanghai, I can say they don’t sell data subscription for less than one year and unlimited does not exist.

I also have bought (180 yuan) a SIM card from China Mobile. I noticed that I can go on the internet. I noticed the APN was “cmnet”.
Then I tried successfully to use the China Mobile SIM card you can buy everywhere for less then 10€.

I will have to refund it once empty, but I’ll comment that post then. I think I will have to plug the SIM card back in a real mobile phone.

Of course I had to cut the SIM card to the micro SIM size.

I was connected to China Mobile and just added APN Settings :
APN name : cmnet
Login : (empty)
Password : (empty)

Chris, leaving soon…

I don’t understand why I should work so hard in Paris and wait some holidays to travel… Money seems to be spent as soon as you earn some, or maybe it’s Paris ? after so many visited countries, I’m sure life can be nicer than that. France is nice, french can sometime be nice too 😉 but it’s nothing compare to what I saw elsewhere. I just take a veeeery loooong time to check if I’m right on this point.

Bolivie Nov2009

I’ve just sold my appartment, and given my resignation. I’m selling everything, even my faithful motorbike.

On July the first, the newly-free Chris will take a fly to visit as much friends around the world as he can. I don’t plan to come back to France, neither did I plan to never come back. Everything is possible from now.

Starting with Laurent and Xiaoia in China, then Marco in Australia, Céline in Argentina, Nathalie & Yann in USA,  Hanne in Norway, Jukka in Finland, George in London, Jucy in Thailand…  and I’ll take time… won’t have to hurry. I won’t have an appointment or a boss waiting for me.

FREEDOM !! I hope to visit or to live parts of Life in a lot of places, meeting people and discovering landscapes, practicing sports here and there, learning languages…  This blog will soon have a lot of articles again

en route !

Spamassassin can learn from Exchange before 2007

I found a better way of teaching Spamassassin from Exchange. But it works trough IMAP. And Exchange 2007 doesn’t allow imap to access to public folders any more 🙁

http://sstern.ccim.com/2006/07/14/training-sitewide-spam-filters/

here is a copy-paste :

How does one enable end-user training of a site-wide Bayesian spam filter for SpamAssassin when the users are reading mail through Microsoft Exchange and the filtering takes place on several Linux MX servers?

We have created two public folders, should-be-spam and should-be-ham. We created an exchange user, spamiam, that has full rights to these folders. End-users move misclassified mail from their inbox or junk-mail folder into the appropriate should-be public folder.

At the top of every hour, this script is run on the one MX server:

/usr/local/scripts/get_ham_spam
#! /bin/sh
rm -f /var/spool/mail/spamiam
touch /var/spool/mail/spamiam
chown spamiam:mail /var/spool/mail/spamiam
su spamiam -c 'fetchmail -a -K -f
/usr/local/scripts/spamiam.fetchmailrc -r "Public Folders/should-
be-spam"'
cat /var/spool/mail/spamiam >> /var/www/html/spamstuff/should-be-spam
sa-learn --spam --mbox /var/www/html/spamstuff/should-be-spam
rm -f /var/spool/mail/spamiam
touch /var/spool/mail/spamiam
chown spamiam:mail /var/spool/mail/spamiam
su spamiam -c 'fetchmail -a -K -f
/usr/local/scripts/spamiam.fetchmailrc -r "Public Folders/should-
be-ham"'
cat /var/spool/mail/spamiam >> /var/www/html/spamstuff/should-be-ham
sa-learn --ham --mbox /var/www/html/spamstuff/should-be-ham

/usr/local/scripts/spamiam.fetchmailrc
poll exchange.xxxx.com
proto imap
user spamiam
password xxxxxxxxx
is spamiam here

At 15 past each hour, the two other mail servers use wget to grab the
should-be files to their local /tmp and run sa-learn.

get-ham-spam
#! /bin/sh
cd /tmp
rm -f should-be-spam should-be-ham
wget -q http://xxx.xxx.com/spamstuff/should-be-spam
wget -q http://xxx.xxx.com/spamstuff/should-be-ham
sa-learn --spam --mbox should-be-spam
sa-learn --ham --mbox should-be-ham

The files are included in logrotate on the source server, so they get zero’d every Sunday
morning.

entourage et Exchange 2007

Lors de notre passage à Exchange 2007, les clients Entourage ne pouvaient plus se connecter.

C’est le site de microsoft qui a fini par m’apporter la réponse : il ne faut pas se contenter de mettre le nom du serveur dans la case : nom de serveur….. il faut mettre

mail.contoso.com/exchange/user@contoso.com

Le pire c’est que lorsque je mettais mail.contoso.com je n’avais aucune erreur, tous les tests étaient passés avec succés, mais il ne me listait jamais les dossiers…

C’était à cette adresse : http://support.microsoft.com/kb/931350/en-us

quotes

“Excellence is the result of caring more than others think is wise, risking more than others think is safe, dreaming more than others think is practical, and expecting more than others think is possible.” Unknown

“A positive attitude may not solve all your problems, but it will annoy enough people to make it worth the effort.” Herm Albright

“Sometimes there is no next time, no timeouts, no second chances, sometimes it’s now or never.” Unknown

“Whether you believe you can or not, you are right.” Henry Ford

“I have not failed; I’ve only found 10,000 ways that do not work.” Thomas A. Edison

“Some of the world’s greatest feats were accomplished by people who were not smart enough to know they were impossible.” -Doug Larson

“Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world.” Albert Einstein

“All that is needed for evil to triumph is for good men to do nothing.” Edmund Burke

“You must have the desire to want it, the strength to endure it, the attitude to become it, and the commitment to achieve it.” Unknown

Exchange 2007 and mailboxes size list ?

I found a solution here, the paste/copy follows :

You would have noticed that you are not able to see the Total Items and Size (KB) of user’s mailboxes in Exchange Management Console of 2007. Even you are not able to add columns optionally.

image

Like you were able to see in Exchange System Manager of version 2003 displayed below.

image

Now question is where to see/add those options… Your answer is run the PowerShell command to see those options.

When I run below command in Exchange Management Shell for Database name “Mailbox Database”, it gives similar output to ESM 2003. Only difference is it shows size in Bytes instead of KB.

Get-MailboxStatistics -database “Mailbox Database” | Select DisplayName, LastLoggedOnUserAccount, ItemCount, TotalItemSize, LastLogonTime, LastLogoffTime | Format-Table

image

Now if I want to export this into CSV the I need to run below command.

Get-MailboxStatistics -Database “Mailbox Database” | Select DisplayName, LastLoggedOnUserAccount, ItemCount, TotalItemSize, LastLogonTime, LastLogoffTime | Export-CSV test.csv

image

Now lets say I want size in MB then I  need to run below command.

Get-MailboxStatistics -Database “Mailbox Database” | Format-Table DisplayName, LastLoggedOnUserAccount, ItemCount, @{expression={$_.totalitemsize.value.ToMB()};label=”Size(MB)”}, LastLogonTime, LastLogoffTime

image

If I want to sort this report by Mailbox Size then I need to run below command.

Get-MailboxStatistics -Database “Mailbox Database” | Sort -Property TotalItemsize | Format-Table DisplayName, LastLoggedOnUserAccount, ItemCount, @{expression={$_.totalitemsize.value.ToMB()};label=”Size(MB)”}, LastLogonTime, LastLogoffTime

image

  • In these examples we got reports for database “Mailbox Database” in same way we can get it for whole server with below command.

Get-MailboxStatistics -Server MailboxServer01

  • Here we added DisplayName, LastLoggedOnUserAccount, ItemCount, TotalItemSize, LastLogonTime, LastLogoffTime columns in our report and in same way we can add below list of columns …

AssociatedItemCount
Database
DatabaseName
DeletedItemCount
DisconnectDate
DisplayName
Identity
ItemCount
LastLoggedOnUserAccount
LastLogoffTime
LastLogonTime
LegacyDN
MailboxGuid
ServerName
StorageGroupName
StorageLimitStatus
TotalDeletedItemSize
TotalItemSize

Hamachi, or how sharing files (or whatever else) throughout any Routers

Hamachi is a centrally-managed zero-configuration virtual private network (VPN) freeware application capable of establishing direct links between computers that are behind NAT firewalls without requiring reconfiguration (in most cases); in other words, it establishes a connection over the Internet that very closely emulates the connection that would exist if the computers were connected over a local area network. Currently available as a production version for Microsoft Windows and, as beta, for Mac OS X and Linux. On August 8, 2006, it was announced that Hamachi was being purchased by LogMeIn.[1]