This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
rsync -av -e "ssh -p XXXX" $1 [email protected]:$2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
// Do any additional setup after loading the view, typically from a nib. | |
NSUInteger a = 5, b = 10; | |
NSInteger c = 8; | |
NSLog(@" a - b = %d", a - b); | |
// a - b = -5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Default setup is given for MySQL with ruby1.8. If you're running Redmine | |
# with MySQL and ruby1.9, replace the adapter name with `mysql2`. | |
# Examples for PostgreSQL and SQLite3 can be found at the end. | |
production: | |
adapter: mysql2 | |
database: redmine | |
host: localhost | |
username: redmine | |
password: ****** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Fuel\Tasks; | |
class MySQLBackup | |
{ | |
public static function system_ex($cmd, $stdin = "") | |
{ | |
$descriptorspec = array( | |
0 => array("pipe", "r"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql> select * INTO OUTFILE 'dump.txt' from テーブル名; | |
mysql> LOAD DATA INFILE 'dump.txt' INTO TABLE テーブル名; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Fuel\Migrations; | |
class Create_users | |
{ | |
public function up() | |
{ | |
\DBUtil::create_table('users', array( | |
'id' => array('constraint' => 11, 'type' => 'int', 'auto_increment' => true), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd /usr/bin/ | |
$ sudo curl -LOk http://xrl.us/cpanm | |
$ sudo chmod +x cpanm | |
$ sudo cpanm local::lib | |
-> FAIL Installing ExtUtils::MakeMaker failed. See /root/.cpanm/build.log for details. | |
-> FAIL Bailing out the installation for App-cpanminus-1.5018. Retry with --prompt or --force. | |
$ sudo yum install perl-devel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo yum groupinstall "Development Tools" | |
$ sudo yum install pkgconfig glib2-devel gettext libxml2-devel pango-devel cairo-devel | |
$ cd /usr/bin/ | |
$ sudo curl -LOk http://xrl.us/cpanm | |
$ sudo chmod +x cpanm | |
$ sudo cpanm local::lib | |
-> FAIL Installing ExtUtils::MakeMaker failed. See /root/.cpanm/build.log for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cpu usage (decimal) | |
cat /proc/loadavg | cut -d ' ' -f 1 | |
# cpu usage (integral) | |
cat /proc/loadavg | cut -d ' ' -f 1 | cut -d '.' -f 1 | |
# cpu usage (integral * 100) | |
cpu=`cat /proc/loadavg | cut -d ' ' -f 1`;echo $cpu*100 | bc | cut -d '.' -f 1 | |
# send your cpu usage (integral) to GrowthForecast every 5 minutes via crontab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// memory usage percent (integral) | |
free | awk 'NR==2' | awk '{print int($3/$2*100)}' | |
// actual memory usage (integral) | |
// http://open-groove.net/linux-command/free/ | |
free | awk 'NR==2' | awk '{print int(($3-($6+$7))/$2*100)}' | |
// swap memory usage percent (integral) | |
free | awk 'NR==4' | awk '{print int($3/$2*100)}' |
OlderNewer