List all tables with sizes in megabytes:
SELECT
table_name AS `Table`,
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB`
FROM information_schema.TABLES
WHERE table_schema = "DATABASE_NAME"
ORDER BY `Size in MB` DESC
IT, PHP, JavaScript, Linux, HTML , CSS
List all tables with sizes in megabytes:
SELECT
table_name AS `Table`,
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB`
FROM information_schema.TABLES
WHERE table_schema = "DATABASE_NAME"
ORDER BY `Size in MB` DESC
First of all we have to stop networking. /etc/network/interfaces file and under eth0 (or other network interface) add following line:
hwaddress ether your_new_mac_address
After that you can start networking again.
Example:
sudo /etc/init.d/networking stop
sudo vi /etc/network/interfaces
#now add: hwaddress ether 01:02:03:04:05:06
sudo /etc/init.d/networking start
Just cd to a folder in Terminal and:
find ./ -name “.svn” | xargs rm -Rf
Using owncloud to store your files in a cloud where you control your data and not some greedy company is becoming more and more popular. Its very convenient and I made two servers one for my job and one my personal, on my personal server. Everything would be OK if not one major drawback of owncloud client application: it doesn’t support more than one servers/accounts. Developers know about it, but don’t plan to change this in the nearest future.
But if you know how to use your Mac and have some unix experience, you can make it work as you want it to! Shortly this method creates another user account on Max OS X and starts the second owncloud client as that user. So here are some steps for a workaround:
1. Create another account in Sysytem Preferences -> Users & Groups. For this tutorial we will call it “owncloudpersonal”.
2. Create a folder where you want your file to be stored and give “owncloudpersonal” user permission to read and write this folder: right click on a newly created folder -> Get Info -> Sharing & permissions -> plus sign.
Select “owncloudpersonal” user and press Select. Now change its privilege to Read & write.
3. Now you have to run another owncloud instance as newly created user. At the moment I’m doing it through Terminal with this command:
sudo -u owncloudpersonal /Applications/owncloud.app/Contents/MacOS/owncloud
You can close terminal app. Owncloud client will run fine without it.
I’m working on moving it to Automator, to not open Terminal app every time I want to start owncloud. I’ve tried this AppleScript but it doesn’t seem to work:
do shell script “sudo -u owncloudpersonal /Applications/owncloud.app/Contents/MacOS/owncloud” with administrator privileges
If you have some ideas, please write in comments.
At the moment it seems that saving password is not working, you have to enter it every time you start second owncloud instance. If you have a solution for this problem, feel free to write it in comments too!
PS. I think linux users can do something quite similar to solve this problem.
I always forget this commands, so here it is:
tar -czvf name.tar.gz folder/
Decompressing (unzipping) is here:
gunzip name.tar.gz
To create a cell in Microsoft Excel in which you can only enter one of predefined values and/or insert there select element, which lets you select the value with a mouse (without typing in values with keyboard) follow these steps:
1. Crete a list of the values that should be in select. Tip: make additional sheet for these lists if you have more than one. It’s commonly called lookup tables.
2. Select a cell or cells range where you want to insert selects and select from Excel menu Data -> Validation.
3. If newly opened window select Allow: List.
4. Press on Source and select a lookup table that you have created in step 1.
5. Check if In-cell dropdown is selected and press OK.
6. Enjoy :)
Screenshots from MAC version, but on Windows its essentially the same:
Have you ever wondered why there is no RGB color selector in XCode? I don’t understand why Apple haven’t put it by default. But thanks to some guy named Wade Cosgrove there is a solution!
All you have to do is:
First of all we have to stop networking. /etc/network/interfaces file and under eth0 (or other network interface) add following line:
hwaddress ether your_new_mac_address
After that you can start networking again.
Example:
sudo /etc/init.d/networking stop
sudo vi /etc/network/interfaces
#now add: hwaddress ether 01:02:03:04:05:06
sudo /etc/init.d/networking start
If you have BlackBerry Playbook but are now in unsupported country, You can’t download or update any applications. Looks like 20th century, doesn’t it? But You know that we are in 21st century and RIM cannot do anything about it ;)
Here I will describe a way to access AppWorld from unsupported country. The only thing you need is Mac with wifi, connected to the Internet using ethernet cable. If You have a PC with windows 7, you can follow this tutorial.
Generally, AppWorld checks Your IP address is it from the country they allow. So basically, we need to change the IP address we are using to one from supported countries. For example from US. To this, we will use VPN.
Firstly, we have to find VPN server with IP from USA and connect our Mac to it. Secondly we have to share this connection through wifi.
How to connect your Mac to VPN you can read here.
How to share this connection read here.
PS. If you don’t want to buy VPN account, try this one for free.
PPS. If you like this post, write it in comments ;)
If you want to make programs for BlackBerry PlayBook Tablet using html5 and javascript you have to download and install SDK. It’s quite simple and described in documentation quite well. But when you start compiling and deploying program to simulator things are getting quite complicated and very badly documented (at least at the time when this post is written). Even a program downloaded from Blackeberry tutorial doesn’t want to compile.
First of all, to compile a program, you have to compress all files of your project (usually those ate html, js, css files and images) into a single zip file. First mistake that you will make is adding whole folder to archive . This doesn’t work ;) You should archive only files. Secondly, there shouldn’t be any unnecessary files like eclipse’s .project or Mac-Os’s .DS-Store hidden files. If compiler will find some of them i zipped file – it will fail.
So here is a short tutorial how to get started developing for BlackBerry PlayBook Tablet using WebWorks (and not Adobe AIR) on MacOs without any software for money.
Inside folder "progs" create file named "compile_deploy" and fill it with: #!/bin/bash dir="sb" #directory name path="/Users/Username/bbwp/" #path to SDK password="pass" #password set on emulator ip="172.16.220.135" #IP of emulator #do not edit from this point cd $dir find . -name '*.DS_Store' -type f -delete zip -r ../$dir.zip * cd .. "$path"bbwp $dir.zip "$path"blackberry-tablet-sdk/bin/blackberry-deploy -installApp -password $password -device $ip -package bin/$dir.bar
In the first part of file there are some variables that should be changed: directory in which is the program (“sb”), path to directory where SDK was installed, password set in emulator, IP address of emulator.
chmod a+x compile_deploy
./compile_deploy
Script that we just created will remove all DS_STORE files, zip all files inside directory, compile progarm and deploy everything into emulator (which by the way should have been started before ;))
If you have any questions feel free to ask in comments.