Feed aggregator
Google In Battle With Its Own Lawyers
Read more of this story at Slashdot.
Seymour Cakes: Node.js express file upload -- uploading file the easy way
Step 1:
Your form must be multipart.
<form name="uploadfile" enctype="multipart/form-data" ...>
Step 2:
Here comes the req.files magic.
app.post('/upload', function(req, res) { console.log( req.files.uploadfile ); console.log( req.files.uploadfile.name ); // use fs.rename to move the file and unlink after that});
Internally express is using formidable to do handle the file upload. But it's a surprise to me that formidable doc is a piece of shit, and express is obviously not advertising this feature enough.
Seymour Cakes: Node.js sendfile and Forbidden error
So instead of res.sendfile( __dirname + "/../public/home.html"), use the path module to normalize the path to the file. Like the below,
path = require('path');var filepath = path.normalize( __dirname + "/../public/home.html");res.sendfile( filepath );
Ditesh Kumar: Hitchens, 1949-2011
Ditesh Kumar: The Chilli Rush Experience
Ditesh Kumar: To Hitch
Ditesh Kumar: There needs to be a better Jobstreet
Ditesh Kumar: Product Evaluation 101 (from the other side of the fence)
Ditesh Kumar: Google Plus Gets a +1
Ditesh Kumar: Console.log-ing objects
Ditesh Kumar: Bersih 2.0
Ditesh Kumar: Implementing UIDL
Ditesh Kumar: Tough & Competent
Using Crowdsourcing To Design More Accessible Elections
Read more of this story at Slashdot.
Ask Slashdot: How Is Online Engineering Coursework Viewed By Employers?
Read more of this story at Slashdot.
Job Seeking Hacker Gets 30 Months In Prison
Read more of this story at Slashdot.
Muhammad Shahriman (Yondie): My New N9. The Half-Cooked Distro
I like my N900 very much, I mean not many people can go around spawn a shell on their palms right? Sadly althought in my humble opinion N900 is the best thing a phone can offer (fully total control on the phone, straight forward cross compiling like u did on your normal nix unlike the other linux.

However it is regret to say that every awesome stuff in the world have it's own Achilles Heel . (The memory is small, the stock speed of the CPU is only 600Mhz, and the usb female charger port is always on the loose).
So I decided to give myself an upgrade to N9. the Supposely to be the successor for N900. with 1Ghz Proc and 1 Gig Ram should have some deep impact right?
So here is the Pros and COns for N9.
- It`s Faster, Amoled
- Multitouch all u need is a swipe.
1. Half Ass Cooked OSThe moment u enabled Developer mode. U realise that the Phone is bundled with Half-Ass determination unlike the N900. Default repo is worst. U didn`t even have the basic unzip package is not available. CMS tool such as svn and git are borked . It's much better to compile everything yourself rather then finding the correct Repo.
2. Limited root even in a developer mode.
This is most likely due to Aegis Security Framework dat is similliar towards SE-Linux. But possess a lot of problem. Any unsigned binary dat did n `t registered with Aegis won`t be executed. Or any code-execution that required root privileged such as raw socket won`t be able to done. Ping is accepted since it's in the Aegis Whitelist. Luckily it was not dat much hassle . There are few tricks u can do ..
- Using Taviso http://seclists.org/fulldisclosure/2010/Oct/257 (Find the allowed suid ) - Flash the firmware back and then apply the open-mode patch. http://maemo.cloud-7.de/HARM/N9/openmode_kernel_PR1.1/
3. No external mmc slot and using microsim instead of normal sim.. (Defakkk?)
So there you go my review on N9. It's really a superb phone that will be abandoned by its maker but not it`s user.

Air Guns Shake Up Earthquake Monitoring
Read more of this story at Slashdot.
Colin Charles: Managing MySQL with Percona Toolkit by Frédéric Descamps
Frédéric Descamps of Percona.
Percona Toolkit is Maatkit & Aspersa combined. Opensource and the tools are very useful for a DBA.
You need Perl, DBI, DBD::mysql, Term::ReadKey. Most tools are written in Perl, and whatever is in Bash is being re-written in Perl. There is also a tarball or RPM or DEB packages.
Know your environment. The hardware & OS are crucial for you to know. How much memory/CPU do you use? Do you use swap? Is this a physical/virtual machine? Do you have free space? What kind of RAID controller? Volumes? Disk? What about the network interfaces? What IO schedulers are used? Which filesystem is the data stored on? To answer all that, just use pt-summary.
Know your MySQL environment. Version? Build? How many databases? Where is the data directory? What about replication? What are key InnoDB settings? Storage engine in use? Index type? Foreign keys? Full text indexes? To answer all this and more use pt-mysql-summary.
pt-slave-find shows you the topology and replication hierarchy of your MySQL replication instances. An inventory of replicas!
Where is my disk I/O going? Use pt-diskstats which is an improved iostat. There is pt-ioprofile but it can be dangerous in production.
Now its time to get more intimate with your database. Let’s try to find the answer to these questions: how are the indexes used? Are there duplicate keys? Which queries are eating most of the resources? You can use pt-duplicate-key-checker to check for duplicate/redundant indexes or foreign keys. pt-index-usage can tell you which indexes are unused. If you think you have bad SQL, check out pt-query-advisor.
You can use pt-query-digest to analyze the slow query log and show a profile of the workload. You mostly use this with slow query logs & tcpdump’s. Be careful when you have dropped packets — results may tend to be fake then!
After all this, its time to maintain your environment.
pt-deadlock-logger checks InnoDB status to log MySQL deadlock information. It needs to run continually to capture things.
pt-fk-error-logger extracts and logs MySQL foreign key errors.
pt-online-schema-change to alter tables. It makes a “shadow copy” and swaps them. Extremely useful for large, long-running ALTER. Facebook uses the same technique.
Validate your upgrades as upgrades are the leading cause of downtime. Are queries using different indexes? Is query execution plan different? New errors? See pt-upgrade for this. Best to run this on a third machine (i.e. the old machine and a new machine to see how it goes).
Verify replication integrity – pt-table-checksum. Perform an online replication consistency check or checksum MySQL tables efficiently on one or many servers. Use it routinely (mandatory for 95% of MySQL users). Put it in a weekly crontab. Repair differences with pt-table-sync.
Repair out-of-sync replicas – pt-table-sync
Measure delay acfurately – pt-heartbeat
Deliberately delay replication – pt-slave-delay
Watch & restart MySQL replication after errors – pt-slave-restart
When there are problems, get the symptoms when it hurts. Look at pt-stalk (wait for a condition to occur them begin collecting data – eg. everytime the threads go over 2,000 you have a problem, so it collects stuff – it calls pt-collect), pt-collect (collect information from a server for some period of time), and pt-sift.
pt-mext looks at many samples of MySQL SHOW GLOBAL STATUS side-by-side. Default STATUS shows counter since the MySQL instances started. It is very helpful to see a delta of recent activity.
The future: pt-query-digest will do query reviews; pt-stalk will do “magical fault detection algorithm”. Its all opensource and its all on Launchpad at lp:percona-toolkit.
Related posts:
- Practical MySQL Indexing guidelines by Stéphane Combaudon
- Replication features of 2011 by Sergey Petrunia
- MySQL synchronous replication in practice with Galera by Oli Sennhauser
Half of Fortune 500s, US Agencies Still Infected With DNSChanger Trojan
Read more of this story at Slashdot.
