afpd on Debian

afp share

When you are on #OSX regularly, CIFS/SMB is not that good option. What you would need to do so is installing afpd and bonjour. Obviously, they won’t name as they are in Apple product. Their package names are netatalk and avahi consecutively. Installation is as easy as one regular apt-get.

Setting up both at the same time, then we would configure later.

# apt-get install netatalk avahi-daemon libnss-mdns

After installation, we need to configure a bit for both service.

afpd — what we are going to do now is to disable legacy Apple File protocol back in pre #OSX time which we don’t need.
# vim /etc/default/netatalk

 # enable new service
CNID_METAD_RUN=yes 
AFPD_RUN=yes 
# disable legacy service 
TIMELORD_RUN=no
A2BOOT_RUN=no
ATALKD_RUN=no
PAPD_RUN=no

All you need to do is making sure if these values are assigned correctly. Next, we have to declare sharepoint. You can append to these new settings to the end of this file.
# vim /etc/netatalk/AppleVolumes.default

/your/path VolumeName allow:@groupname options:usedots,upriv

Example:
You can do a share by username.

~/ "$u" allow:myusername options:usedots,upriv

For Time Machine, you can do this; it might be a good idea to limit volume size before Time Machine takes over the whole drive by using volsizelimit:100000 in MB; 100000 = 100GB

/home/username/TimeMachine "TimeMachine" allow:myusername options:usedots volsizelimit:100000

Restart netatalk to see the change
# /etc/init.d/netatalk restart

For more info: http://linux.die.net/man/5/applevolumes.default

Avahi (Bonjour)
Next, we need to do help setting up bonjour or avahi. A setting file is /etc/nsswitch.conf which is belong to mDNS (mDNS comes helping hostname resolution.) we need to enable mdns module by add “mdns” to hosts: line as following:

hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 mdns

Last but not least, we customize how any device see afpd. Create a new file named /etc/avahi/services/afpd.service and paste this in.

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
 <name replace-wildcards="yes">%h</name>
 <service>
 <type>_afpovertcp._tcp</type>
 <port>548</port>
 </service>
 <service>
 <type>_device-info._tcp</type>
 <port>0</port>
 <txt-record>model=MacPro</txt-record>
 </service>
</service-group>

You can change model to something else which change icon you will see on #OSX client side. AppleTV, iMac, MacPro, Xserve, MacBook, MacBookPro, MacBookAir, Macmini, etc.

Restart avahi-daemon to see the change

# /etc/init.d/avahi-daemon restart

Popularity: 1% [?]

MacJournal to Evernote

I was a short-period Evernote user after OneNote took over by all features and everything many years ago. However, once I moved to Mac OSX, I had yet to find a right tool as OneNote alternative. Although VMWare Fusion 4 has been improved over the years, why on Earth I have to keep Windows running wasting my memory at all time.

I tried a lot of alternatives: OneNote on VMWare Fusion — Unity view of course, MarsEdit, OmnifocusCircusponies Notebook, Journler, MacJournal, Springpad (webapp), Catch (webapp.) As a result, MacJournal it was by its simplicity for months. However, lacking of synchronization sucked big time, esp. with all mobile devices. Then there was an underdog option showing up again. Evernote. At least this piece of software was built with cloudsync in mind.

Well, this time, after couple years w/o using EverNote, I could say that it’s been vastly improved. It’s still far from OneNote counterpart, but this is all you can get on OSX. The question left is how to move all data in MacJournal to Evernote?

Like everybody else. I googled for a solution; I found a script which gave me an error, at least for me. Suddenly I thought of why we have to complicate life this much. So I decided to select all my journal entry, drag them all and drop into Evernote!

Boom! it works! way too easy, right? it works beautifully also. Evernote will show up tons of windows when it completely grabs each journal, but you can always wait a bit and close them all at once with cmd+q. After reopening Evernote, you would more than happy.

note: downside — tag doesn’t come along, but there is always a search, right?

Popularity: 1% [?]

FreeNAS 8 – cave man can do it

It’s FreeNAS. It’s easy. Set it and forget it with full fledge NAS you can’t find anywhere else. Well, it might not have DRBD, but for home/personal or even small business should be able to cope with rsync easily.

At least, this version makes me happy. My SS4200 comes alive w/ port multiplier; it just lives up to its potential.

Kernel log speaks louder than anything.

+pmp0 at siisch1 bus 0 scbus1 target 15 lun 0
+pmp0: < Port Multiplier 0325197b 000e > ATA-0 device
+pmp0: 300.000MB/s transfers (SATA 2.x, NONE, PIO 8192bytes)
+pmp0: 300.000MB/s transfers (SATA 2.x, NONE, PIO 8192bytes)
+pmp0: 15 fan-out ports
+ada1 at siisch1 bus 0 scbus1 target 1 lun 0
+ada1: ATA-8 SATA 2.x device
+ada1: 300.000MB/s transfers (SATA 2.x, UDMA5, PIO 8192bytes)
+ada1: Command Queueing enabled
+ada1: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C)
+ada2 at siisch1 bus 0 scbus1 target 0 lun 0
+ada2: ATA-8 SATA 2.x device
+ada2: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
+ada2: Command Queueing enabled
+ada2: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C)
+ada3 at siisch1 bus 0 scbus1 target 3 lun 0
+ada3: ATA-8 SATA 2.x device
+ada3: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
+ada3: Command Queueing enabled
+ada3: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C)
+ada4 at siisch1 bus 0 scbus1 target 2 lun 0
+ada4: ATA-8 SATA 2.x device
+ada4: 300.000MB/s transfers (SATA 2.x, UDMA5, PIO 8192bytes)
+ada4: Command Queueing enabled
+ada4: 1907729MB (3907029168 512 byte sectors: 16H 63S/T 16383C)

Thanks, FreeBSD guys enabling this feature. Thanks, FreeNAS folks developing nice-and-easy NAS.

Popularity: 3% [?]

Thai font for webOS

Well, after HP dumped #webOS device w/o caring how many languages those devices can read. We, as a user, are supposed to be on our own then.

Here is fonts you need to replace, Arial & Prelude families. These are sorta main fonts in webOS. Actually you can replace only Prelude for webOS 2.x or older, but likely you need both for webOS 3.

What I have done? You definitely can copy any font w/ Thai character and rename to Prelude for all webOS 2.x or below. restart Luna once. It will work. However, I just like to have Prelude as it was. I only add Thai characters to that font. So as in this Arial.

How can you replace these fonts? there are many possible ways to do so, but I guess you have to have some sort of shell, XTerm preferably, and surely you probably need to have Preware first. Then you should be able to simply copy this font over the original one.

root@Touchpad: /var/home/root# cp /media/internal/newfont/* /usr/share/fonts/

Once you copy these over, restart Luna once. All set =) If you need anything else, just give me a shout in comment =)

ps. well, FYI, I did put Thai character of TH SarabunNew into webOS’s Arial and Thonburi’s into Prelude.

note: due to excessive spamming, I couldn’t approve real people comments in time. I have to delete spams in database instead. If you guys which have a problem are still around, let me know again. Sorry for inconvenience. I think I’ll move to #Disqus avoiding this issue as soon as possible.

Popularity: 6% [?]

Multiple Profiles — A hero after Google Apps has transitioned

I don’t know if anyone is in on the same boat as me. Back then, I was on both Google Apps mail and Gmail at the same time. However, once Google decided to change Google Apps account to be more like normal Google account. Things get rough; I have to use Firefox for one account and Chrome for the other. Yeah, it’s a pain in the butt. However, I just discovered that Chrome has such a nice feature called “Multiple Profiles.” Basically, it lets you have different sets of session and else on different windows and of course they provide a nice touch identifying each profile by avatar on top-right of each window.

First, you have to enable “multiple profiles” flag by go to about:flags, find Multiple Profiles and enable it. Then you have to restart your Chrome once. There you go!
Multiple Profiles -- Google Chrome

Popularity: 2% [?]

Too many connections on MySQL server

If you are new to administrate all your web and database server and wonder how you can tweak to their best, you are just like me. My job was to build a webapp in order to handle roughly 10 grand of users, and this app was database-driven one. Its database is about 15GB with 25M records and is growing steadily. Well, traffic is also growing twice a month, approx. 8,000 visits; 260,000 pageviews a day as of now, according to Google Analytics. It’s relatively small if you compare to all giant sites these days. However, it’s not as easy as it seems once you are a coder, but have to manage all these things too. I’ll try to share as much information as I could as time goes by.

After I tweaked on coding side, e.g. indexing, using cache, bla bla bla, as much as I know. I have faced some weird issue that database server was down randomly while it didn’t even eat up all memory or frequently an popular “Too many connections” popping up. After googling for a while, I found that it could relate to several things: maximum connection on MySQL itself which is 100 as a default; maximum open files which is depending on OS; or simply out of memory. In my case, it surely is not memory issue, since top/free confirmed me about that. Then I have changed both maximum connection on MySQL and maximum open files on Linux:-

in /etc/my.cnf, you have to add another line setting this:

[mysqld]
max_connections = 250 # or whatever

This would set new maximum connection limit for the database server, but it doesn’t guarantee if it can handle that–that’s also OS and memory related. After this change, restart MySQL daemon once to see the change.

For maximum open files, you can check by ulimit -n, if it’s over MySQL maximum connections, you can skip this part. If not, heading to /etc/security/limits.conf, and you can simply add:-

* hard nofile 2048
* soft nofile 2048

If you are using SSH, you have to restart sshd once for new setting. So far, I’m happy with the new role and having fun tweaking it. If you have any suggestion, please share!

Popularity: 1% [?]

Colorizing VIM

The more you use vim, the further you are from all other text editors. However, when you get your new box ready, vim is likely not to enable syntax color by default. You can choose to do that individually or for everyone. If you decide to let other manage this on their own, you can just create ~/.vimrc or you can opt for system wide setting in /etc/vim/vimrc.

in /etc/vim/vimrc, you will find:-

" syntax

on which mean it’s commented out. What you have to do is uncomment it, save, and try. For ~/.vimrc, you can just touch that file and type syntax on or you can just do:

$ echo 'syntax on' > ~/.vimrc

That should do it.

Popularity: 2% [?]

Mac OSX and CIFS/SMB relationship

After I had a problem transferring file over CIFS with my Macbook Pro, there are a lot of issues: stopping copying, missing files in a destination although successful operation. That was frustrated and surely I can’t give up on Samba just yet. I even have to do rsync or cp to get expectable outcome from such a simple task. By the way, after stumble across threads, KBs, I found the solution that make me happy for couple weeks so far.

Here is what I was looking for Mac OSX 10.5, 10.6: About named streams on SMB-mounted NAS

What you have to do is pretty simple, enabling named streams on Mac OS X client–yeah my machine! By opening up Terminal and type as following:-

echo "[default]" >>  ~/Library/Preferences/nsmb.conf
echo "streams=yes" >> ~/Library/Preferences/nsmb.conf

That is enabling named streams as a default for all smb connection. This makes my day indeed — not worrying if copying works as it should or not.

Popularity: 2% [?]

me & Snow Leopard after first 2 weeks

For the record, I had been using Mac OSX way way back to iBook G3; as I remember, it’s Tiger back then. I didn’t have much love for Mac OSX. That’s why I turned to Vista (believe it or not, I think it’s better than Tiger in many ways), and Windows 7. Nonetheless, destiny always plays us. I have to get a new machine after 3-year+ with X61 Tablet. X200 Tablet is my next target, but in Thailand, unfortunately, there is none available in brick and mortar store. It’s required a special order which takes like a month or so with *extra special price :( * to get which is much more expensive than Macbook Pro. Thus, I decided to get Macbook Pro with matte screen & i7. My decision of purchasing Macbook Pro is about hardware alone since I didn’t think of software as a barrier.

I won’t go through all detail right away since I still need more time to adjust my routine to suit Mac OSX to get a fair comparison. In short, pros and cons I have found are below.

Pros:

  • [software] Apple makes me believe that their trackpad is good; after I have so much love for Thinkpad trackpoint.
  • [software] OSX handle multiple monitors well (just 2 monitors so far) [Linux is way way behind Mac OSX/Windows]
  • [software] Never in love with multiple workspaces, but Spaces does the job very very well.
  • [software] OSX handle most of Google thingys well: iCal, Address Book rocks w/Google account.
  • [software] Mail app is way better than Live Mail in Windows.
  • [software] Spotlight is as good as Windows Search.
  • [software] VMWare Fusion is pretty damn good with a unity feature; it makes you believe that Windows app is native Mac app.
  • [software] Gotta love having bash shell as default. To me, it’s better than DOS.
  • [hardware] Macbook Pro looks very very nice.
  • [hardware] MagSafe should be on every laptops!

Cons:

  • [software] OSX just can’t handle copying files [from cifs to another cifs, multiple copy & paste, multiple times of drag & drop, copying files within many many level of folders] It doesn’t matter if it’s Windows’ thing. If OSX supports it, MAKE IT fully compatible. >> here is a fix.
  • [software] Emptying trash is a pain in the ass; I don’t know what they do, how secure they are doing, but there is no choice for unsecured and fast one. That’s bad enough. shift+option+cmd+del is good enough to empty everything although it might take few hours.
  • [software] iWork is useless to me–I can’t even open MS Word file.
  • [software] Microsoft Office for Mac is below par when it comes to compatibility with Windows version–It’s not OS fault, but most people around me use Windows, that makes this a con. I expect much better app-and-OS-independent here.
  • [software] Missing OneNote! there is none as good also. VMWare Fusion comes being a hero here.
  • [software] no Windows Live Photo replacement–I hate iPhoto which can do only in its own library. Adobe Bridge comes close but it’s not built for viewing tons of photo in many folders at once. Picasa has its own way of keeping all info. I don’t like that. (I stick with spacebar to preview for now.)
  • [software] a change of not showing SMB/CIFS mount on desktop in Snow Leopard is very very awkward. In Tiger, if you mount CIFS path, you will get a link on desktop. This can be achieved with ln -s, but why make this more complicated than it used to be? my bad that I couldn’t find this: firing up Sidebar Preference | General Tab | you will see connected servers show on desktop option! checked!
  • [hardware] 2 USB for top-of-the-line machine?
  • [hardware] Screen isn’t IPS-comparable; this is less than I expected. At least Thinkpad X200 Tablet will come with a better panel.
  • [hardware] no PgUp/PgDw and many buttons on Mac keyboard, but I do love having CMD as an extra.

I know that many are applications’ cons, but if I only include what OS can do, not considering 3rd party app too, it would be non real-world experience. Is there anyone still uses computer w/o any 3rd party software nowadays? I’m sure I will have a lot more to add here; wait and see.

 

Popularity: 9% [?]