aliyun主机挂载硬盘

1、
fdisk -l
 
Disk /dev/xvda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00073f45
 
    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1        2611    20970496   83  Linux
 
Disk /dev/xvdb: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
 
2、
fdisk -S 56 /dev/xvdb
 
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xffcb1daf.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
 
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
 
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').
 
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-29371, default 1): 
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-29371, default 29371): 
Using default value 29371
 
Command (m for help): wq
The partition table has been altered!
 
Calling ioctl() to re-read partition table.
Syncing disks.
 
 
3、
mkfs.ext4 /dev/xvdb1
 
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
13107200 inodes, 52427228 blocks
2621361 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
1600 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872
 
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
 
This filesystem will be automatically checked every 35 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
 
4、
 
echo '/dev/xvdb1  /data ext4    defaults    0  0' >> /etc/fstab
mkdir /data
mount -a

参考资料
http://help.aliyun.com/manual?spm=0.0.0.0.07tnFu&helpId=271

原创文章,转载请注明: 转载自海波无痕

本文链接地址: aliyun主机挂载硬盘

文章的脚注信息由WordPress的wp-posturl插件自动生成

发表在 server | 标签为 | 留下评论

ubuntu编译wget

wget http://ftp.gnu.org/gnu/wget/wget-1.14.tar.xz;
tar -xvf wget-1.14.tar.xz;
sudo apt-get install libgnutls-dev;
 
cd wget-1.14;
vi src/url.c;
  quoted = 0;
  for (p = b; p < e; p++)
    if (FILE_CHAR_TEST (*p, mask)  && !((*p | 0x0fffffff) == 0xffffffff) )
      ++quoted;
./configure 
make && sudo make install
 
wget \
--header 'Host:baidu.com' \
--header 'Cookie:' \
--header 'Referer:' \
--header 'User-Agent:Mozilla/5.0 (Windows NT 5.1; rv:25.0) Gecko/20100101 Firefox/25.0' \
--post-data '' \
'http://baidu.com'

原创文章,转载请注明: 转载自海波无痕

本文链接地址: ubuntu编译wget

文章的脚注信息由WordPress的wp-posturl插件自动生成

发表在 server | 标签为 | 留下评论

linux查询目录下包含某字符的文件命令

grep -F '站站' -R .
 
find . |xargs grep "VPSeek"
 
grep -rl 'test.qyqy.cn' * | xargs sed -i "s/test.qyqy.cn/ziki.cn/g"
 
wget -m -r -np -p –restrict-file-names=nocontrol -o ddd.log http://www.ziki,cn
 
#-k -K
 
 
 
convert -resize 720x1280 *.png *.jpg
 
 
http://151wqooo.blog.51cto.com/2610898/1162118
http://blog.longygy.com/linux%E5%9C%A8%E6%96%87%E4%BB%B6%E5%A4%B9%E4%B8%AD%E6%9F%A5%E6%89%BE%E6%96%87%E4%BB%B6%E5%8C%85%E5%90%AB%E7%9A%84%E5%AD%97%E7%AC%A6%E4%B8%B2%EF%BC%8C%E5%B9%B6%E8%BF%9B%E8%A1%8C%E7%9B%B8%E5%BA%94.html/
http://www.vpseek.com/shell-command-examples/locate-files-that-contains-specified-text-string.html

原创文章,转载请注明: 转载自海波无痕

本文链接地址: linux查询目录下包含某字符的文件命令

文章的脚注信息由WordPress的wp-posturl插件自动生成

发表在 server | 标签为 | 留下评论

使用android命令创建android项目

mkdir myapp;
cd myapp;
/data/android/android-sdk-linux/tools/android create project --name myapp --target android-19 --path . --package com.ziki.myapp --activity  MainActivity

原创文章,转载请注明: 转载自海波无痕

本文链接地址: 使用android命令创建android项目

文章的脚注信息由WordPress的wp-posturl插件自动生成

发表在 Uncategorized | 标签为 | 留下评论

vbox更改vdi硬盘的序列号

VBoxManage internalcommands sethduuid xp.vdi

原创文章,转载请注明: 转载自海波无痕

本文链接地址: vbox更改vdi硬盘的序列号

文章的脚注信息由WordPress的wp-posturl插件自动生成

发表在 Uncategorized | 留下评论

mysql函数计算两个坐标之间的直线距离

创建mysql 函数 用来计算坐标距离

 
SET GLOBAL log_bin_trust_function_creators=1;
 
DROP FUNCTION GetDistance;
 
DELIMITER $$
 
-- 计算两点直线距离 传入参数
-- 返回距离 单位为米
CREATE FUNCTION GetDistance (lat1 DOUBLE ,lng1 DOUBLE ,lat2 DOUBLE ,lng2 DOUBLE )
	RETURNS DOUBLE
BEGIN
	DECLARE radLat1 DOUBLE ;
	DECLARE radLng1 DOUBLE ;
	DECLARE radLat2 DOUBLE ;
	DECLARE radLng2 DOUBLE;
	DECLARE a DOUBLE;
	DECLARE b DOUBLE;
	DECLARE p DOUBLE ;
	SET p =  PI();
	SET radLat1 = lat1 * (p)/ 180.0;
	SET radLng1 = lng1 * (p)/ 180.0;
	SET radLat2 = lat2 * (p)/ 180.0;
	SET radLng2 = lng2 * (p)/ 180.0;
	SET  a = radLat1 - radLat2;
	SET  b = radLng1 - radLng2;
	RETURN  1000 * ROUND (2 * ASIN(SQRT(POW(SIN(a/2),2) + COS(radLat1)*COS(radLat2)*POW(SIN(b/2),2))) *6378.137  * 10000 ) /10000;
END$$

测试语句

SELECT GetDistance( 39.911146,116.433593  ,39.911033,116.437677) AS distance
 
348.9
 
/**
	 * 获取两点之间的距离
	 * @param a
	 * @param b
	 * @return
	 */
	public static double GetDistance(Location a,Location b){
 
		try{
 
			String jsstring = " function GetDistance( lat1,  lng1,  lat2,  lng2){ " +
				"if( ( Math.abs( lat1 ) > 90  ) ||(  Math.abs( lat2 ) > 90 ) ){" +
				"        return 0;" +
				"}" +
				"if( ( Math.abs( lng1 ) > 180  ) ||(  Math.abs( lng2 ) > 180 ) ){" +
				"        return 0;" +
				"}" +
 
				"var radLat1 =  lat1 * Math.PI / 180.0;" +
				"var radLat2 =  lat2 * Math.PI / 180.0;" +
				"var radLng1 =  lng1 * Math.PI / 180.0;" +
				"var radLng2 =  lng2 * Math.PI / 180.0;" +
				"var  a = radLat1 - radLat2;" +
				"var  b = radLng1 - radLng2;" +
				"var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a/2),2) + Math.cos(radLat1)*Math.cos(radLat2)*Math.pow(Math.sin(b/2),2)));" +
				"s = s *6378.137 ;" +
				"s = Math.round(s * 10000) / 10000;" +
				"return s*1000;" +
				"}";
 
			ScriptEngineManager mgr = new ScriptEngineManager(); 
			ScriptEngine engine = mgr.getEngineByName("JavaScript");
			engine.eval(jsstring); 
			Invocable inv = (Invocable) engine;   
			Object ob = inv.invokeFunction("GetDistance",a.getLat(),a.getLng(),b.getLat(),b.getLng());
			if(ob instanceof Double ){
				return (Double)ob;
			}
		}catch(Exception e){
			log.error(e.getMessage(),e);
			return -1;
		}
		return -1;
 
	}

QQ图片20131023114314

原创文章,转载请注明: 转载自海波无痕

本文链接地址: mysql函数计算两个坐标之间的直线距离

文章的脚注信息由WordPress的wp-posturl插件自动生成

发表在 server | 标签为 , , , | 留下评论

解决ubuntu下华为c8813q手机adb识别乱码

1、usb连接手机,在shell下输入 lsusb 查看型号

Bus 002 Device 005: ID 12d1:1038 Huawei Technologies Co., Ltd. Ideos (debug mode)

2、sudo gedit /etc/udev/rules.d/51-android.rules
增加

SUBSYSTEM=="usb", SYSFS{idVendor}=="12d1", MODE=="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", ATTR{idProduct}=="1038", SYMLINK+="android_adb"

3、用华为手机拨号程序拨打拨号输入
*#*#2846579#*#*
选择菜单 projectMenu
接着选择后台设置
选择 USB 模式
选择 Google 模式

4、重启 adb

4750bfbf2c8788618cd6e114718a93[……]

Read more

发表在 soft | 标签为 , , , | 留下评论

ubuntu12.4 LTS amd64升级linux kernel 3.4

下载
http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.4-precise/

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.4-precise/linux-image-3.4.0-030400-generic_3.4.0-030400.201205210521_amd64.deb
 
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.4-precise/linux-headers-3.4.0-030400_3.4.0-030400.201205210521_all.deb
 
dpkg -i linux-image-3.4.0-030400-generic_3.4.0-030400.201205210521_amd64.deb
dpkg -i linux-headers-3.4.0-030400_3.4.0-030400.201205210521_all.deb
 
参考资料
http://blog.51osos.com/linux/ubuntu-12-04-linux-3-4/
http://www.ubuntubuzz.com/2012/05/install-kernel-340-stable-on-ubuntu.html

不升级不行,firefox +flash 频繁死机。

原创文章,转载请注明: 转载自海波无痕

本文链接地址: ubuntu12.4 LTS amd64升级linux kernel 3.4

文章的脚注信息由WordPress的wp-posturl插件自动生成

发表在 server | 标签为 | 留下评论

U盘格式化

C:\Users\hello>diskpart
 
Microsoft DiskPart 版本 6.1.7600
Copyright (C) 1999-2008 Microsoft Corporation.
在计算机上: HELLO-PC
 
DISKPART> list disk
 
  磁盘 ###  状态           大小     可用     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  磁盘 0    联机              931 GB   585 GB
  磁盘 1    联机             7604 MB  7601 MB
 
DISKPART> select disk 1
 
磁盘 1 现在是所选磁盘。
 
DISKPART> clean
 
DiskPart 成功地清除了磁盘。
 
DISKPART>

退出命令,进入微软的磁盘管理工具

原创文章,转载请注明: 转载自海波无痕

本文链接地址: U盘格式化

文章的脚注信息由WordPress的wp-posturl插件自动生成

发表在 soft | 留下评论

HTC Sensation G14

1、官方解锁
2、获取ROOT权限
3、S-OFF

参考资料
http://forum.xda-developers.com/showthread.php?t=1614617
http://www.clockworkmod.com/rommanager
http://www.htcsensationroms.com/
http://unlimited.io/jb_pyramidlocked.htm

原创文章,转载请注明: 转载自海波无痕

本文链接地址: HTC Sensation G14

文章的脚注信息由WordPress的wp-posturl插件自动生成

发表在 soft | 标签为 | 留下评论
Pages: Prev 1 2 3 4 5 6 7 8 9 10 ... 20 21 22 Next