simple
(0 comments, 60 posts)
This user hasn't shared any profile information
Home page: http://www.macmanitou.de
Yahoo Messenger: macmanitou
Jabber/GTalk: macmanitou
AIM: macmanitou
Posts by simple
How to drop multiple tables in MySQL
0If you want to drop multiple tables in MySQL (current version 5.05 or before) you will find no command for that. But there is a simple way using some console commands, just hit your shell and simply paste this snippet:
mysqldump -u [USER] -p [PASSWORD] --add-drop-table --no-data [DATABASE] | grep ^DROP | mysql -u [USER] -p [PASSWORD] [DATABASE]
Do not forget to replace [USER], [PASSWORD] and [DATABASE] with your settings. As always with remove operations be careful and backup!!!
ISPConfig3: Mail aliases for login to Dovecot
0If you knew ISPConfig2 you probably remember the user login approach which was done there:
Login: web23p2 Password: OurBrilliant Password
Now with ISPConfig3 this has changed to the better by using the users email address – sounds cool – it is!
But what about migration from ispconfig 2 to ispconfig 3 – you do not want to drive around and setup every user account again – or send emails and then the user fails to set it up.
To prevent that you can just add an alias column to the mail user table
ALTER TABLE `mail_user` MODIFY COLUMN `alias` varchar(255) NOT NULL DEFAULT '' AFTER `email`;
Then just fill it with the old logins like webXpX using phpMyAdmin, Sequel Pro or even the console.
If you are done with that, just login to your server and change the dovecot sql config file:
nano /etc/dovecot/dovecot-sql.conf
by changing the user and password queries:
password_query = SELECT password FROM mail_user WHERE (email = '%u' OR alias = '%u') AND disable%Ls = 'n'
user_query = SELECT email as user, maildir as home, CONCAT(maildir, '/Maildir') as mail, uid, gid, CONCAT('maildir:storage=', quota) AS quota, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (email = '%u' OR alias = '%u') AND disable%Ls = 'n'
I will update this post when I figure out the postfix stuff…
You are done – hope that this saved your weekend
Mac OS X: Ever wanted to integrate your Macs in a Active Directory environment with Two-factor authentication (Part 1)?
0Simple AD Integration using knowledge as authentication key, is for some data to protect not enough. So if you want to raise the bar you add ownership (Smartcard, USB Dongle, e.g.) to the knowledge only authentication system.
So first stone on your way if you use Snow Leopard, you have to be aware that the Directory Utility has been moved from the Utility folder to Core Services. /System/Library/CoreServices/
Then you might want to enable the smart card login feature of Mac OS X using Apple’s nice walk-trough
http://support.apple.com/kb/TA24244
If can not get you Smart Card based solution running using Apple’s on board tools, you might consider using Centrify’s active directory Implementation:
http://www.centrify.com/directcontrol/mac_os_x.asp
If you are still unsure what you really need, there is a very good post about alternative authentication methods for Mac OS X from Ryan Faas @peachpit
http://www.peachpit.com/articles/article.aspx?p=725691
Of course you might ran in some problems and traps, to prevent you from going wild, there are some ongoing discussions at the Apple Boards:
http://discussions.apple.com/thread.jspa?threadID=2131654&start=30&tstart=15
SEO: Blackhat Tactics – Part 1
0During working on a customer SEO project I just came across a competitor which is massively using black hat SEO tactics. Ethically now the question pops up, if the right approach is to respond by using the same or even better tactics. So here are some interesting reads on how to approach this situation.
Black hats really like to use automatic content generators, which post answers to forum posts or blog comments, just by querying databases like e.g. Yahoo Answers:
http://developer.yahoo.com/answers/
The tools used here are in my opinion highly black stuff, so if you follow these links you do it on your own and have been warned:
http://www.blackhatworld.com/blackhat-seo/cloaking-content-generators/65432-phpbb-auto-forum-poster.html
http://www.blackhatworld.com/blackhat-seo/cloaking-content-generators/28074-best-auto-content-generator.html
http://www.blackhatworld.com/blackhat-seo/black-hat-seo-tools/174743-fastest-way-harvest-relevant-urls.html
http://www.blackhatworld.com/blackhat-seo/black-hat-seo-tools/35060-any-one-have-auto-forum-poster-forum-leecher-tools-collect-automated-post-other.html
http://www.wjunction.com/showthread.php?t=29288
http://megarapid.net/forums/p/56059/56059.aspx
http://www.blackhatworld.com/blackhat-seo/cloaking-content-generators/25315-forum-content-generator.html
http://www.xdreams.ch/black-hat/blackhat-seo-blogs/
And there are even some “commercial” tools for forum and blog posts, to support you with your black thinking:
http://www.instadigi.com/
http://www.scrapebox.com/
And if you need a good content generator just head over to:
Feel free to do what ever you read in the links, but be warned that these tactics might get you blocked by google or other SEs for years…
On the opposite I can just sit down and read another nice SEO Book
iPhone OS: Enterprise Business Tools
0If you need to manage iPhones or iPads in a big enterprise business, your should read Apples Support Documents:
http://www.apple.com/de/support/iphone/enterprise/
and in any case download the iPhone Configuration Tools for Mac OS X:
http://support.apple.com/kb/DL851
and for Windows:
http://support.apple.com/kb/DL926
You can then setup configuration profiles, that reflect the setup of your environment:
• Passcode-Richtlinien
• Funktions-Einschränkungen
• Wi-Fi-Einstellungen
• RADIUS-Authentifizierung
• VPN-Einstellungen
• E-Mail-Einstellungen
• LDAP
• CalDAV
http://www.docstoc.com/docs/1811411/Apple-iPhone-and-iTouch-Enterprise-Deployment-Guide
iPhone OS: Design a nice InApp Purchase View
0To get up a nice InAppPurchase View for Apple’s AppStore, we first need some good looking buttons:
http://code.google.com/p/iphonegradientbuttons/
http://undefinedvalue.com/2010/02/27/shiny-iphone-buttons-without-photoshop/
http://iphonedevelopment.blogspot.com/2010/05/improved-gradient-buttons.html
http://stackoverflow.com/questions/422066/gradients-on-uiview-and-uilabels-on-iphone/
There are also some tweaks for the UITableView you might consider using:
http://stackoverflow.com/questions/400965/how-to-customize-the-background-border-colors-of-a-grouped-table-view/
http://stackoverflow.com/questions/986392/programmatically-force-a-uiscrollview-to-stop-scrolling-for-sharing-a-table-view/
more information upcoming…
iPhone OS: Setup an additional Security Layer
0As you might already know the iPhone is itself not that secure that people might think (news is german):
http://www.heise.de/security/meldung/Luecke-in-Datenverschluesselung-des-iPhones-1007818.html
How do you prevent intrusion of your customers data? As a really pragmatic approach, we can just set up additional encryption for our application data:
http://stackoverflow.com/questions/2579453/nsdata-aes-class-encryption-decryption-in-cocoa
http://iphonedevelopment.blogspot.com/2009/02/strong-encryption-for-cocoa-cocoa-touch.html
http://pastie.org/974094/
So if you use for example core data, then on application start you decrypt the database and after termination encrypt it, using the AES class. These are only some basic thoughts and I think that you are better of using higher encryption like blowfish 448bit or even combine it with AES256bit. These encryption is
Your data might live now a little bit securer, but to prevent also code intrusion, you REALLY should strip symbols and obfuscate your code:
http://stackoverflow.com/questions/2442189/write-secure-cocoa-code
and never ever store any secrets or keys in your code!
Also there are some nice reads from Apple you might consider looking at:
http://images.apple.com/iphone/business/docs/iPhone_Security_Overview.pdf
iPhone OS: ffmpeg for the iphone – Part 1
0I am just checking if it is possible to get WMV9 support for one of my applications on the iphone using ffmpeg.
The good point a lot of people tried to get these working, but actually none covered if his application was approved for the AppStore. Due to Apples guidelines there might be some problems to get an approval. For now just some informations, I already collected:
http://code.google.com/p/ffmpeg4iphone/
http://github.com/yuvi/gas-preprocessor/
http://stackoverflow.com/questions/1679649/using-ffmpeg-library-with-iphone-sdk-for-video-encoding
These where basically my first finds – interesting reads, but after some more searching I found what I was really looking for, build scripts for Cortex8, arm1176jzf and i386 (aka iPhone Simulator)
http://github.com/gabriel/ffmpeg-iphone-build
If you combine these with the iFrameExtractor example project I found here:
http://www.codza.com/extracting-frames-from-movies-on-iphone
you got a really nice demo project for the use of ffmpeg, which is also able to run in the iPhone Simulator. Lots of video formats are supported out of the box and you can also for example play Adobe Flash files. Streaming capabilities are there, but for flash you might need to fiddle a bit.
I will setup a demo project and ask the codza guys if they have no problem if I host it here.
Terminal: Search and Replace text in all files in a folder and its subfolders
0I just stumbled across a neat idea using perl to replace the content in files
To replace all occurances of a string:
find ./ -name “*.txt” | xargs perl -pi -e ‘s/stringtoreplace/replacementstring/g’
for every of these examples you can also use sed
find ./ -name “*.txt” | xargs sed -i ‘s/stringtoreplace/replacementstring/’
or rpl
rpl stringtoreplace “replacementstring” ./
or numeros other solutions …
To replace the first occurance:
find /your/home/dir -name “*.txt” | xargs perl -pi -e ‘s/stringtoreplace/replacementstring/’
To replace all files in a folder:
for arg in `ls -C1`; do perl -pi -e ‘s/stringtoreplace/replacementstring/g’; done;
you can do more cool tricks using the for shell command as demonstrated above. you can add more specific searches. However, you might be better off just writing a shell script. Here is an example of the first find:
for arg in `find /your/home/dir -name “*.txt”` ; do perl -pi -e ‘s/string/replacement/g’ $arg; done;
Scalable second-generation distributed database
0A good friend of mine just showed me two links to scalable second-generation distributed database, I want to share with you.
This approach is my favorite one – as it is the underlying database of Digg, Facebook, Twitter and many others. It is written in Java and released under the Apache License:
The other approach is written in C and released under the GNU General Public License Version: