Wednesday, June 29, 2011
Monday, June 27, 2011
MySQL: Check, repair and optimize tables (all tables, all databases)
MySQL check, repair or optimize:
- all tables in a databases
- all tables from all databases
- a certain table
Check tables for all databases:
Check tables for a certain database:
Optimize table:
Repair table:
Auto-repair tables:
- all tables in a databases
- all tables from all databases
- a certain table
Check tables for all databases:
$ mysqlcheck -u root -p -v --all-databases
Check tables for a certain database:
$ mysqlcheck -u root -p -v db_name
Optimize table:
$ mysqlcheck -u root -p -v --optimize db_name table_name
Repair table:
$ mysqlcheck -u root -p -v --repair db_name table_name
Auto-repair tables:
$ mysqlcheck -u root -p -v --auto-repair db_name
Labels:
mysql
Linux - rm - Argument list too long - Solution
When deleting too many files in one directory using rm the following error can appear: "rm: Argument list too long".
Problem:
Solution:
Problem:
$ rm *
bash: /bin/rm: Argument list too long
Solution:
$ find ./ -name "*file_name_part*" -delete
Labels:
linux
Twitter Advertising, next step
Twitter is looking to introduce more advertising, targeting its most active sections: Twitter plans bolder advertisements
Labels:
Twitter
Sunday, June 26, 2011
Ubuntu convert VOB to AVI
How to convert VOB to AVI in Ubuntu:
ffmpeg -i video.vob -sameq new-video.avi
ffmpeg -i video.vob -sameq new-video.avi
Labels:
ubuntu,
video editing
Thursday, June 16, 2011
FaceBook is loosing customers in U.S., Canada and other countries
FaceBook is loosing users in countries it was first established.
For the month of May: - 6 mil. users in U.S. (from 155.2 mil. to 149.4 mil.), - 1.52 mil. users in Canada (to 16.6 mil.), - 100.000 users each in U.K., Norway, and Russia.
Overall, the total number of FaceBook users increased by 1.7% driven by growth in other countries (Brazil, Mexico, etc).
The reasons are multiple:
- too much noise on the network
- privacy issues and concerns
- constant bombardment with unsolicited material
- aggressive way of introducing new features
...
For the month of May: - 6 mil. users in U.S. (from 155.2 mil. to 149.4 mil.), - 1.52 mil. users in Canada (to 16.6 mil.), - 100.000 users each in U.K., Norway, and Russia.
Overall, the total number of FaceBook users increased by 1.7% driven by growth in other countries (Brazil, Mexico, etc).
The reasons are multiple:
- too much noise on the network
- privacy issues and concerns
- constant bombardment with unsolicited material
- aggressive way of introducing new features
...
Labels:
faceoff
Wednesday, June 15, 2011
Google Voice Search available on personal computers
Google Voice Search available on personal computers, laptops, mobile phones and any other devices.
For laptop/PC the only requirements in order to use Google Voice Search are Google Chrome Web Browser and a microphone of course. More about this:
http://googleblog.blogspot.com/2011/06/knocking-down-barriers-to-knowledge.html
For laptop/PC the only requirements in order to use Google Voice Search are Google Chrome Web Browser and a microphone of course. More about this:
http://googleblog.blogspot.com/2011/06/knocking-down-barriers-to-knowledge.html
Labels:
Google Voice Search
Google Instant Pages, under Chrome
After performing a Google Search, from the results displayed, Google makes a "guess" about which result you will click. Based on this "guess", only when you are using Google Chrome Web Browser, Google "prerenders" (preloads) the page you are about to click on. The result: when you click on that result, the target site loads instantly.
More info:
http://googlewebmastercentral.blogspot.com/2011/06/announcing-instant-pages.html
http://blog.chromium.org/2011/06/prerendering-in-chrome.html
More info:
http://googlewebmastercentral.blogspot.com/2011/06/announcing-instant-pages.html
http://blog.chromium.org/2011/06/prerendering-in-chrome.html
Labels:
Google Search
Tuesday, June 14, 2011
Bursa de domenii
InfoDomenii.ro :: Cumpara si vinde domenii pe bursa de domenii. Gaseste parteneri pentru reclama web. Promoveaza-ti serviciile si afacerea.
Monday, June 13, 2011
Javascript: Automatically adjust iframe height to fit content
This solves the need to adjust the height of an iframe depending on the length of the content inside the iframe. The iframe may contain images, text, etc.
This solution is also appropiate for the situations when you have a form inside an iframe and the number of the fields of the form changes dynamically (javascript) depending on user actions. Also the display of form errors above the form may be a cause for content stretching over the predefined height of the iframe.
Technical description: The height of the iframe's content is read from inside the iframe and a function from the parent window is called in order to modify the height.
File 1, dynamic-height-adjusting-iframe.html :
File 2, dynamic-height-adjusting-iframe-content.html :
This solution is also appropiate for the situations when you have a form inside an iframe and the number of the fields of the form changes dynamically (javascript) depending on user actions. Also the display of form errors above the form may be a cause for content stretching over the predefined height of the iframe.
Technical description: The height of the iframe's content is read from inside the iframe and a function from the parent window is called in order to modify the height.
File 1, dynamic-height-adjusting-iframe.html :
<html>
<head>
<title>read element height</title>
<script type="text/javascript">
function adjustIframeHeight(_h) {
var new_h = _h + 50;
document.getElementById('my_iframe').style.height = new_h + 'px';
}
</script>
</head>
<body>
<div>
Other text here<br/>
Other text here<br/>
Other text here.<br/>
</div>
<iframe id="my_iframe" src="dynamic-height-adjusting-iframe-content.html" width="730" height="650" scrolling="no" frameborder="1" marginwidth="0" marginheight="0" style="border-top:2px solid #ccc;border-left:2px solid #ccc;border-right:2px solid #ddd;border-bottom:2px solid #ddd;"></iframe>
</body>
</html>
<head>
<title>read element height</title>
<script type="text/javascript">
function adjustIframeHeight(_h) {
var new_h = _h + 50;
document.getElementById('my_iframe').style.height = new_h + 'px';
}
</script>
</head>
<body>
<div>
Other text here<br/>
Other text here<br/>
Other text here.<br/>
</div>
<iframe id="my_iframe" src="dynamic-height-adjusting-iframe-content.html" width="730" height="650" scrolling="no" frameborder="1" marginwidth="0" marginheight="0" style="border-top:2px solid #ccc;border-left:2px solid #ccc;border-right:2px solid #ddd;border-bottom:2px solid #ddd;"></iframe>
</body>
</html>
File 2, dynamic-height-adjusting-iframe-content.html :
<html>
<head>
<title>read element height</title>
<script type="text/javascript">
function getXYpos(elem) {
if (!elem) {
return {"x":0,"y":0};
}
var xy={"x":elem.offsetLeft,"y":elem.offsetTop}
var par=getXYpos(elem.offsetParent);
for (var key in par) {
xy[key]+=par[key];
}
return xy;
}
function getHeightBetweenElements(elem1, elem2) {
var xy1 = getXYpos(elem1);
var xy2 = getXYpos(elem2);
return xy2.y - xy1.y;
}
function adjustMySelf() {
var h = getHeightBetweenElements(document.getElementById('pos-reper1'), document.getElementById('pos-reper2'));
parent.adjustIframeHeight(h);
}
</script>
</head>
<body>
<div id="pos-reper1"></div>
<div style="width: 300px; margin: 0 auto;">
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
</div>
<div id="pos-reper2"></div>
<script type="text/javascript">
adjustMySelf();
</script>
</body>
</html>
<head>
<title>read element height</title>
<script type="text/javascript">
function getXYpos(elem) {
if (!elem) {
return {"x":0,"y":0};
}
var xy={"x":elem.offsetLeft,"y":elem.offsetTop}
var par=getXYpos(elem.offsetParent);
for (var key in par) {
xy[key]+=par[key];
}
return xy;
}
function getHeightBetweenElements(elem1, elem2) {
var xy1 = getXYpos(elem1);
var xy2 = getXYpos(elem2);
return xy2.y - xy1.y;
}
function adjustMySelf() {
var h = getHeightBetweenElements(document.getElementById('pos-reper1'), document.getElementById('pos-reper2'));
parent.adjustIframeHeight(h);
}
</script>
</head>
<body>
<div id="pos-reper1"></div>
<div style="width: 300px; margin: 0 auto;">
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
</div>
<div id="pos-reper2"></div>
<script type="text/javascript">
adjustMySelf();
</script>
</body>
</html>
Labels:
javascript
Javascript: Read element height containing dynamic text
Read the height of any DOM element (paragraph, div, etc) which doesn't have a height predefined and contains dynamically generated text (variable length content).
Example, file read-element-height.html :
Example, file read-element-height.html :
<html>
<head>
<title>read element height</title>
<script type="text/javascript">
function getXYpos(elem) {
if (!elem) {
return {"x":0,"y":0};
}
var xy={"x":elem.offsetLeft,"y":elem.offsetTop}
var par=getXYpos(elem.offsetParent);
for (var key in par) {
xy[key]+=par[key];
}
return xy;
}
function getHeightBetweenElements(elem1, elem2) {
var xy1 = getXYpos(elem1);
var xy2 = getXYpos(elem2);
return xy2.y - xy1.y;
}
</script>
</head>
<body>
Other text here<br/>
Other text here<br/>
Other text here.
<div id="container">
<div id="pos-reper1"></div>
<div style="width: 300px; margin: 0 auto;" id="container-text">
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
text sakfjdsio fdiojsifojdsio fjdiojs fds
</div>
<div id="pos-reper2"></div>
</div>
<div>
Height of the dynamic text box (between 'pos-reper1' and 'pos-reper2') is:
<script type="text/javascript">
var h = getHeightBetweenElements(document.getElementById('pos-reper1'), document.getElementById('pos-reper2'));
document.write(h + 'px');
</script>
</div>
<div>
Adjusting container height and adding extra 50px...
<script type="text/javascript">
var h_container = h + 50;
document.getElementById('container').style.height = h_container + 'px';
document.getElementById('container').style.backgroundColor = 'PaleGoldenrod';
</script>
</div>
</body>
</html>
Labels:
javascript
Sunday, June 12, 2011
Scroll parent window from child iframe
Scroll parent window to top, from child iframe:
<script type="text/javascript">
parent.scroll(0, 0);
</script>
parent.scroll(0, 0);
</script>
Labels:
javascript
Thursday, June 9, 2011
Exclude directories from TAR archive - CACHEDIR.TAG file
Prevent TAR from archiving directories of your choice. Add the file CACHEDIR.TAG in the directory you don't want it to be archived, with the following content:
$cat CACHEDIR.TAG
Signature: 8a477f597d28d172789f06886806bc55
# marked as cache in order to be excluded from scheduled backup
Linux - change default editor (usually `vi`) - set new editor: `mcedit`
To change the default editor (for commands like `crontab -e`), run:
export VISUAL='mcedit'
export EDITOR='mecedit'
Both above lines should be added to ~/.bashrc in order to keep this setting permanent.
Change default editor in MC (Midnight Commander):
In mc menu select: Options -> Configuration -> use internal edit
export VISUAL='mcedit'
export EDITOR='mecedit'
Both above lines should be added to ~/.bashrc in order to keep this setting permanent.
Change default editor in MC (Midnight Commander):
In mc menu select: Options -> Configuration -> use internal edit
Labels:
linux,
mcedit,
midnight commander
Monday, June 6, 2011
Subscribe to:
Posts (Atom)