如果你突然发现你的SSD不是4k对齐。但是你已经使用SSD一段时间,并且上面已经有一堆资料不能重新分区了怎么办?

试试这个工具吧: MiniTool Partition Wizard 

这个工具可以将没有4k对齐的SSD做到4k对齐。当然,对齐之前建议你备份硬盘上的重要数据。

下载地址: http://www.partitionwizard.com/

minitool

 

对齐以后别忘用AS SSD Benchmark测试性能有无提升~

突然一不小心删除了某些重要文件,虽然马上关机了。但是手边又没有合适的PE光盘来启动并且找到合适的数据恢复软件怎么办?

这个时候你可能就用得上Ubuntu的Live CD。然后用Live CD启动机器。在Linux环境下恢复硬盘上误删除的数据。

  • ntfsundelete
    这是Ubuntu自带的一个ntfs分区数据恢复命令行工具

下面几个工具呢,需要在Ubuntu的Software Source里面Check “Community-maintained Open Source software (universe)”.

  • testdisk
    这个软件包里面包含了TestDisk,用来恢复丢失的分区以及坏道;和Photorec,支持从多种不同文件系统里面恢复多种文件格式的文件。
  • Foremost
    据说是美国空军开发的用于数据恢复的软件。
  • scalpel
    功能和Foremost差不多,但是适用于配置比较低的机器。

OK,介绍完毕。希望大家都不要碰到文件误删/丢失的情况。也就不用做数据恢复了。

最近发现Piriform提供的几个免费软件还是很好用的,给大家介绍下

  1. CCleaner
    大名鼎鼎的CCleaner不会不知道吧?著名的系统垃圾清理软件。可以清理系统里面不需要的各种临时文件啊,日志文件啊。
  2. Defraggler
    磁盘碎片整理工具,如果你觉得硬盘速度越用越慢的话,可以试试用这个工具整理一下磁盘碎片。
  3. Recuva
    数据恢复软件。如果你磁盘上有数据被误删了的话,赶快用这个工具恢复!
  4. Speccy
    系统硬件信息查看工具。功能类似于AIDA32或者卤大师。可以检测出系统的各种硬件配置。

对了,不要说半天把网址忘记了:http://www.piriform.com/

 

First verify that Tomcat is running on port 8080. Run the following command

# netstat -ntl

The output will look something like

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN
tcp        0      0 ::ffff:127.0.0.1:8005       :::*                        LISTEN
tcp        0      0 :::8009                     :::*                        LISTEN
tcp        0      0 :::8080                     :::*                        LISTEN
tcp        0      0 :::22                       :::*                        LISTEN

Run the following command to redirect port 80 traffic to port 8080

# iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080

Run the folloing command to verify that redirect is working fine

# iptables -t nat -L

The output will look something like

Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination
REDIRECT   tcp  --  anywhere             anywhere            tcp dpt:http redir ports 8080

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination

Run the following command to remove the routing

# iptables -t nat -D PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080

 

FROM: Glass Onion Blog

Today in this article we are going to discuss about some tools and commands that might answer your questions like name of your motherboard’s chipset, NIC type, etc. Some of the tools are in built into any Linux system and others need to be downloaded.

Example 1: lspci command

This standard Linux utility shows what your systems have got internally. The command is combination of ls, the standard command to list files and PCI that is for the peripheral connection. You can also expect your results to include AGP and onboard components like your USB chipset.

The command is much helpful in diagnosing bugs related to PCI devices.Using -t option of lspci command you can see PCI layout in a tree format.继续阅读

mysql按照备份恢复方式分为逻辑备份和物理备份。逻辑备份是备份sql语句,在恢复的时候执行备份的sql语句实现数据库数据的重现,物理备份就是备份数据文件了,比较形象点就是cp下数据文件,但真正备份的时候自然不是的cp这么简单。

这2种备份各有优劣,一般来说,物理备份恢复速度比较快,占用空间比较大,逻辑备份速度比较慢,占用空间比较小

下面介绍以下3种常用的备案方法

一、mysqldump工具备份

mysqldump由于是mysql自带的备份工具,所以也是最常用的mysql数据库的备份工具。支持基于InnoDB的热备份。但由于是逻辑备份,所以速度不是很快,适合备份数据量比较小的场景。
mysqldump完全备份+二进制日志 —>实现时间点恢复

温备:

在使用MyISAM引擎中,只能使用温备份,这时候要防止数据的写入,所以先加上读锁

这时候可以进入数据库手动加读锁。这样比较麻烦,在mysqldump工具中直接有一个加锁的选项

mysqldump –databases mydatabase –lock-all-tables –flush-logs> /tmp/backup-`date +%F-%H-%M`.sql

如果是针对某张表备份,只要在数据库名称后面加上表名称就行了

这里注意,要实现时间点的恢复,加上–flush-logs选项,在使用备份文件恢复后,然后再基于二进制日志进行时间点的恢复

时间点的恢复方法

mysqlbinlog mysql-bin.000000x > /tmp/PointTime.sql

然后用mysql命令导入这个sql脚本就行了

热备:如果使用的是InnoDB引擎,就不必进行对数据库加锁的操作,加一个选项既可以进行热备份:–single-transaction
mysqldump –databases mydb –single-transaction –flush-logs –master-data=2 > /tmp/backup-`date +%F-%H-%M`.sql

注意点
恢复的时刻关闭二进制日志
mysql>set sql_log_bin=0;
因为这是基于逻辑备份方式,在恢复日志时会执行sql语句插入数据,而恢复时候插入数据的日志没有意义。

二、基于LVM快照备份

在物理备份中 ,有基于文件系统的物理备份(LVM的快照),也可以直接用tar之类的命令打包。但这些只能进行冷备份
不同的存储引擎能备份的级别也不一样,MyISAM能备份到表级别,而InnoDB不开启每表一文件的话就只能备份整个数据库。

下面就介绍下使用LVM的快照功能进行备份
为了安全 首先在数据库上施加读锁
mysql>FLUSH TABLES WITH READ LOCK;

刷新一下二进制日志,便于做时间点恢复

mysql>FLUSH LOGS;

然后创建快照卷

lvcreate –L 1G –s –n data-snap –p –r /dev/myvg/mydata

最后进入数据库释放读锁

UNLOCK TABLES;

挂载快照卷进行备份

mount –r /dev/myvg/data-snap /mnt/snap

然后对/mnt/snap下的文件进行打包备份
还原的时候,关闭mysqld,然后备份二进制日志后将原来备份的文件还原进去,然后通过二进制日志还原到出错的时间点(通过二进制还原时间点的时候不要忘了暂时关闭二进制日志)

三、使用percona提供的xtrabackup(推荐)

支持InnoDB的物理热备份,支持完全备份,增量备份,而且速度非常快,而且支持InnoDB引擎的数据在不同数据库迁移
为了让xtrabackup支持更多的功能扩展,配置InnoDB每表一个文件的功能
在my.cnf的mysqld中加入此项: innodb_file_per_table=1
此项不启用将不支持备份单独的表
但如果之前没有启用这个选项,要实现单表一文件的话,可以用mysqldump导出数据,然后启用该选项,恢复回去后就是单表一文件了

首先下载xtrabackup,下载地址:http://www.percona.com/software/percona-xtrabackup,可以直接下载rpm包安装即可。

xtrabackup有完全备份,增量备份和部分备份(前面开启innodb每表一文件,就是为了此功能)

1.完全备份整个数据库

innobackupex –user=root –password=123456 /tmp/backup

此时会在/tmp/backup目录下生成以时间为名的文件夹,里面是备份文件

在这里,备份的数据还不能直接用来还原,因为备份数据中会含有尚未提交的事务或者未同步到数据文件中的事物。这里需要用prepare回滚事物使数据文件处于一致性。

innobackupex –apply-log /tmp/backup/dir

处理完成后才能用来还原数据,用此命令还原

innobackupex –copy-back /tmp/backup/dir

要实现时间点还原,还是需要使用二进制日志

2.增量备份

增量备份支持Innodb,对于MyISAM只能完全备份
innobackupex –incremental /tmp/backup/incremental –incremental-basedir=/tmp/backup/dir

在进行一次增量备份–incremental-basedir要指向上一次增量备份的目录

如果要进行还原,先进行prepare处理

这里处理的方式,将备份合并

innobackupex –apply-log –redo-only /tmp/backup/dir

innobackupex –apply-log –redo-only /tmp/backup/dir –incremental-dir=/tmp/backup/incremental

最后使用完全备份的那个备份还原

至于差异备份,只要每次将basedir指向完全备份文件夹就行了

最后再废话一句:要实现时间点还原,是需要使用二进制日志的,所以备份好二进制日志至关重要。除非在恢复时间点和上一次备份时间点这段时间的数据对你来说无所谓。

If you’re waiting until your refrigerator gasps out its last breath of cold air to shop for a new one, you could be missing out on a chance for big savings. Timing your purchases to coincide with manufacturer discounts, clearance sales and off-season discounts will take the stress out of finding a good price on almost anything.

We spoke with a few experts to get the inside scoop on the best times of the year to shop.

Air conditioners

Best time: Winter
Common sense prevails in the air-conditioning market, according to Diane Ritchey, editor of Home Appliance magazine. “Think about when they’re most in use — May through September. People feel the heat and they start to buy. The stock gets depleted, the demand is higher and so is the price. When cool weather comes around, most people just aren’t into air-conditioner purchasing, so the demand drops, as does the price,” she says.

Airline tickets

Best time: It dependsThere really is no best time of the year to buy plane tickets. But, if you expect to travel around the holidays, always plan ahead because deals are hard find.

“If you can get a good deal for Thanksgiving and Christmas at any time — buy it. That is their peak period and airlines have a limited inventory,” says Neil Bainton, chief operating officer of Farecompare.com, a travel planning Web site that tracks airline ticket prices.

In general, for nonholiday domestic travel, Bainton recommends that travelers never buy tickets more than 90 days away from their departure dates. “You want to watch the 21-day mark because some carriers will file their lowest fares as a 21-day advance purchase. And then the next window is at 14 days, which you really don’t want to go by unless you’re feeling lucky, “says Bainton. Getting a good ticket price depends on the competition in the markets you’re flying to and from and the supply of seats versus the demand.

Fares can change at the drop of a hat; airlines file updates to their fares three times per day: 10 a.m., 12:30 p.m. and 8 p.m. weekdays, with one filing on Saturday and Sunday. “Most of the lowest fares are filed Tuesdays, Wednesdays and sometimes Saturdays. It depends on the carrier and the market,” says Bainton.

Big appliances

Best time: September and October
Just like the fall clothing influx, new models of major appliance models such as ranges and washing machines hit showroom floors in September and October, says Home Appliance’s Ritchey. At about the same time, last year’s models go on sale to make room.

“Critical timing and seeing the patterns of the retail world can make a huge difference in appliance shopping,” says Ritchey.继续阅读

因给自己的S400换了固态硬盘,需要重装会出厂预装的win8基础版,用了网上最新的win8基础版安装,却遇到了“输入的产品密钥与用于安装的任何可用windows映像都不匹配”不能安装。于是到国外网站上打了打酱油,发现原来可以这样解决:

1、打开winISO打开MSDN win8 RTM光盘镜像,找\Sources\ei.cfg 文件。如没有可在\Sources\目录中自己创建。
2、修改ei.cfg如下,就能强制安装win8 oem基本版–现在很多笔记本预装的。
[EditionID]
Core
[Channel]
OEM
[VL]
0
标准的ei.cfg文件中有三个参数:[EditionID]、[Channel]、[VL],其中[Channel]是必须要有的,没有这个参数是无法安装的,其他两个参数可以没有。
1.参数[EditionID]指定安装版本,删除[EditionID],安装时会显示“版本列表”。如果保留这个参数,那么它的值必须正确才可以安装。
2.参数[Channel]指定安装协议,填写“Retail、Volume、OEM”都可以,只是安装时显示的文字不同而已,安装完毕后没有影响,但是不能缺少这一参数。
3.参数[VL]表示是否批量授权,“1”表示是,“0”表示否。如果填写其它错误值(非0和1),对安装系统来说没有影响。
安装完成,但不能联网激活自动,可能要打电话激活。

另外查看自己bios中厂家预制win8版本key可以使用RW – Read & Write utility找ACPI Table的MSDM,再用The Ultimate PID Checker查出自己的key是什么版本,然后就能决定装什么版本的win8能够合法激活,不用到处去找破解了。支持正版!

PID 输入查找到的序列号到红的地方,就会显示结果,s400给大家的OEM win8是 core countryspecific OEM。