All posts by linskystar

LINUX SERVER PHP configurations.

Yesterday, i finished the whole process to built up a completely new LAMP stacks. After that, i am going to import my test server to my production server.

During this transition, i have to upload my sql database dump from my production server 1 to this new server.

Unfortunately, there is a problem for myself that i left off from yesterday’s process. I did not modify any of the PHP configuration. Therefore, i wasn’t able to upload the sql file which size 14MB.  By default,t he upload single file is only 2MB.

So, today i am going to dig into this php configuration file and do some modifications.

First, i would go to change the file php.ini. You can run following command to edit the php.ini file. (Sometime it’s stored in /etc/php.ini, but it also could be in /etc/php.d/cgi/php.ini or /usr/local/etc/php.ini)

vi /etc/php.ini

Then use the vi ‘s search function to search for below syntax and modify to suit your needs. (type in /strings to find your keyword and use keybaord i to get into insert mode to modify it one by one.)

memory_limit = 32M
upload_max_filesize = 10M
post_max_size = 20M

here is the search function: i type in /post_max and then hit enter

vi-search

Then, the cursor will jump to the result it found

search-result

After all the modification has been completed, you can do following command to restart the apache

sudo service httpd restart

LINUX(LAMP) stack 安装日记

今天重装了一台服务器的LAMP stack.纯粹做个日记,下次就可以参考参考了。哈哈。

系统:CentOS7 x86_64_1511
console远程登陆软件:Putty
stack选择:LINUX(centos7),Apache,MySQL,PHPD

首先安装好了linux.为了方便查看,装的时候选择了basic web server with GUI的包装。

跳过安装步骤。全部设置好,然后吧不需要的东西先删除掉。比如libreoffice的软件之类。然后确保磁盘空间分配正确。下面开始安装LAMP的网络服务包
为了方便安装,使用了SSH从另外一台电脑链接网络进去进行一下网络服务的安装。
putty

APACHE的安装命令

这个命令是进行Yum的安装包的更新和所有软件的更新

sudo yum update (yum软件包的更新。如果你是类似我一样是新系统,可能会更新一段时间。因为很多包的下载还是蛮多的。我就下载了奖金700多MB的新软件包更新。)
sudo yum install httpd(这个是进行apache的安装。apache的软件包名字就叫做httpd)
sudo systemctl start httpd.service (这个是开始运行apache的服务)
sudo systemctl enable httpd.service(这个是吧apache的服务运行加入启动就自动运行。
这里有一点比较重要的是,我每次进行centos的服务器的LAMP配置都会遇到的。不一定所有人多会有,那就是当我在本地网络的其他电脑的浏览器输入这个centos服务器的网络地址进行访问的时候,正常会显示apache的默认欢迎的网页。可是很多时候都是无法访问的,这个时候就需要进行防火墙的配置了。我在下面进行了防火墙加了两个端口。(我记得之前在做research的时候,有些人建议直接吧防火墙关闭了。虽然这个是本地的服务器和网络,可是安全期间,还是建议不要完全关闭,只要吧你需要的端口打开即可。)

sudo firewall-cmd –permanent –add-port=80/tcp
sudo firewall-cmd –permanent –add-port=443/tcp

以上两个命令在防火墙的命令配置里面增加了80和443的端口。
sudo firewall-cmd –reload
上面这个命令则是进行防火墙的重启。之后再试试看。是不是就可以打开了apache的经典默认欢迎界面了。

apache-default-screen

下面就开始mysql的安装了,这里我用了mariadb的安装包。这是社区开发版的MySQL

sudo yum install mariadb-server mariadb

mariadb

sudo systemctl start mariadb(开启服务)
sudo systemctl enable mariadb.service(开启开机自动启动服务)
sudo mysql_secure_installation(这个命令会进行mysql的初始化设置的一些工作)
mysql-installation
具体安装的设置,都不是那么困难,所以就大概讲一下:

Enter current password for root (enter for none):
OK, successfully used password, moving on…

第一个问题是问你当前的root密码。因为是首次安装,自然是没有面。直接回车跳过。
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
… Success!

然后问你要不要进行密码设置,输入y然后进行密码设置
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
… Success!

上面这一段话是说,默认情况下mariadb有匿名用户账户。这可以让任何人都进去却不需要创建账户。然后问你是否要删除掉匿名用户权限。当然就是回答y了!

Normally, root should only be allowed to connect from ‘localhost’. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n
… skipping.

正常情况,root只可以从本地访问。这可以杜绝别人从网络访问去猜测root的密码。是否拒绝root的远程登陆。因为我经常要从本地和远程登陆进行管理。所以我会回答n 给这个问题。

By default, MariaDB comes with a database named ‘test’ that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
– Dropping test database…
… Success!
– Removing privileges on test database…
… Success!

默认情况下,mariaDB自带了一个叫做test的数据库,这个是完全拿来做测试用的blah blah.我直接回答y去吧这个数据库给删除掉了。

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
… Success!

Cleaning up…

All done! If you’ve completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

要不要重置所有权限,这样之前所做的所有改动就会立即生效。直接回答y就好了。

接下来就开始安装PHP了。
sudo yum install php php-mysql

yum-install-php

sudo systemctl restart httpd.service (重启apache的服务)

最后,做一个简单的php的探针的编写进行测试:

sudo vim /var/www/html/info.php

输入以下内容:

<?php

phpinfo();

?>
接着,用浏览器打开http://主机ip地址/info.php如果可以看到一下界面就完全成功了!

php-info

Last but not the least is to install phpmyadmin. This is a very useful tool with GUI to manage the MySQL database on the centos7 server.
Now, run the following commands:

sudo yum install php-gd php-pear (Install two very important php related packages.)
sudo yum install epel-release-7-1.noarch.rpm (This is to add the epel release package to the repo.)
sudo yum install epel-release (install and update the epel release package lists)
sudo yum install phpmyadmin (Install the phpmyadmin)

After that, if you go ahead and access http://ipaddress/phpmyadmin you should see something different message other than the 404 now.

Unfortunately, you still cant access phpmyadmin yet. Now, you need to change the file

vi /etc/httpd/conf.d/phpMyAdmin.conf
Below is the file what it looks like the first time you open it.

# phpMyAdmin - Web based MySQL browser written in php
# 
# Allows only localhost by default
#
# But allowing phpMyAdmin to anyone other than localhost should be considered
# dangerous unless properly secured by SSL

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin

<Directory /usr/share/phpMyAdmin/>
   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       Require ip 127.0.0.1
       Require ip ::1
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from 127.0.0.1
     Allow from ::1
   </IfModule>
</Directory>

<Directory /usr/share/phpMyAdmin/setup/>
   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       Require ip 127.0.0.1
       Require ip ::1
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from 127.0.0.1
     Allow from ::1
   </IfModule>
</Directory>

# These directories do not require access over HTTP - taken from the original
# phpMyAdmin upstream tarball
#
<Directory /usr/share/phpMyAdmin/libraries/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/lib/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/frames/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

# This configuration prevents mod_security at phpMyAdmin directories from
# filtering SQL etc.  This may break your mod_security implementation.
#
#<IfModule mod_security.c>
#    <Directory /usr/share/phpMyAdmin/>
#        SecRuleInheritance Off
#    </Directory>
#</IfModule>

Modify and add below items to. Check out the bold text carefully.

<Directory /usr/share/phpMyAdmin/>
   AddDefaultCharset UTF-8

   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       #ADD following line:
       Require all granted
       Require ip 127.0.0.1
       Require ip ::1
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     #CHANGE following 2 lines:
     Order Allow,Deny
     Allow from All
     Allow from 127.0.0.1
     Allow from ::1
   </IfModule>
</Directory>

After i did the above two changes, i would do a httpd restart service again.

sudo systemctl restart httpd.service

Boom! PHPMYADMIN!~ YAHOO~

phpmyadmin

RealVNC全攻略教程

在我们开始进入realVNC的超级马里奥世界之前。要说明一些术语的解释。
RealVNC是一款远程登陆软件。类似winxp自己附带的Remote desktop connection这个软件。但是和Remote Desktop connection的最大不同是。VNC是一个开放协议。所有经过VNC协议下编写的软件都有连接到RealVNC的服务器的功能。 这里我们用到的是RealVNC这个软件。(普通版是免费的。已经有了绝大部分我们所需要的功能了。)而且最大的好处是,realVNC还提供了winxp,linux以及很多不同操作系统平台下的客户端以及服务器端软件,非常实用非常强大。
在远程登陆软件中。一般分为2个软件。一个称为服务器端,一个称为客户端。服务器端运行于任何一台PC上,而且对应不同的操作系统平台还有不同的软件版本。服务器端的作用是向客户端发送服务器端口的当前运行状态和连接的电脑的屏幕内容。客户端的功能就比较明显了。客户端是抓取服务器端的当前运行系统的屏幕。并回显在客户端上,然后客户端对服务器端进行操作。RealVNC里面把客户端叫做Viewer,观看者(程序)。但是基本上和大多数的远程登陆软件的客户端是一样功能的。

这里,我们开始这个教程吧。首先,我们需要从网上下载RealVNC这个软件。
http://www.realvnc.com/cgi-bin/download.cgi   这个地址可以下载到对应各个平台的realVNC平台的软件包。或者你可以选择只下载viewer—客户端。如果您已经配置好了服务器端。无需再次下载。这样可以节省很多时间。完整软件包则包含了服务器端和客户端了。这里,我们下载了windows 版本来测试。注意,安装过程无太大变化。所以直接跳过。仅需注意安装目录即可。
安装完毕之后,在 开始菜单-所有程序-RealVNC这里找到realVNC的所有软件。在下一级菜单,我们可以看到VNC server 4(server mode)和VNC server 4 (user mode)还有一个VNC viewer4.这里的server mode即是运行服务器端的软件和部分所需配置软件。

RealVNC全攻略教程 - Promise - Promise  (不好意思,手中只有英文版本的winXP.基本上的设置都大同小异。在图中的 All Program就是中文xp里面的 所有程序 选项了。)

如果这个时候已经万事具备,那么你就可以直接进入server mode文件夹,然后点start server来运行服务端了。在运行服务端之前。让我们打开configure VNC server进行一些基本配置吧。如图所示。显示VNC server properties(server-Mode).这个是服务端的设置程序。我们首先点Authntication这个项目。然后选中VNC password Authentication(密码验证),然后点右边的configure进行密码设置。在右图所示的密码输入窗中输入密码2次。然后点OK确认即可完成密码验证的设置。
RealVNC全攻略教程 - Promise - PromiseRealVNC全攻略教程 - Promise - Promise

配置好密码之后,我们点Desktop进行 服务端的桌面背景的一些设置。
其中在while connnected之下,有3个选项。分别对应意思是:
Remove wallpaper   去除桌面背景。
Remove background pattern 去除背景图案。
Disable user interface effects 去除用户界面特效。(动画以及很多影响网速的因素的特效之类。)
这是当客户端连接到当前的服务端运行的主机的时候,进行的一个加快网络传输的设定。比较有用。记住一定要慎重思考,选择自己必须的的选项。因为VNC主要使用到服务端的上传界面,而上传界面又是广大ADSL众最珍稀的速度资源。所以能够节省这部分贷款,自然就尽量节省了。

RealVNC全攻略教程 - Promise - Promise

以上的桌面选项配置好之后,我们可以拉回到刚才的密码配置选项旁边的connection(连接)这里看一下。一般保持默认即可。建议仅对这部分网络知识比较丰富的朋友进行修改。
选择上Accept connection on port 5900 表示接受连接到端口5900的连接请求。这个是默认,普通用户请勿修改。
disconnect idle clents after (seconds): 3600  这个选项则是在无动作用户的无回应多少秒之后自动断开连接。
serve java viewer via http on port 5800      接受java版本的viewer(客户端)通过http协议连接到5800端口。

在access control选项下面可以添加不同的规则,比如allow(同意连接),deny(拒绝连接),query(询问,回答是/否之后才可以进行连接)。然后添加不同的ip地址即可实现类似防火墙的功能。

RealVNC全攻略教程 - Promise - Promise

到这里,RealVNC的服务器端就基本配置完毕了。基本上就可以实现VNC承诺的大部分功能了。还有其他的一些没有提到的设置,大家可以自己挖掘。这下,大家可以直接运行start VNC server来运行服务端软件了。

不过如果你使用的是windows XP sp2或者以上版本。你还要做一些windows防火墙的设置以让windows接受来自客户端的连接请求。以下是具体设置步骤:

首先,在图中的 My Network places(网上邻居)点一下。打开新窗口

RealVNC全攻略教程 - Promise - Promise

这里默认显示您的网上邻居以及他们共享给你的文件夹。这里我们忽视掉吧。
直接点左边的 查看网络连接 。

RealVNC全攻略教程 - Promise - Promise

右边的内容会改变一些。我们在本地局域网连接上点properties(右键)。(如果是无线连接照样做吧。)然后选择属性。
RealVNC全攻略教程 - Promise - Promise
打开网络连接属性窗口之后,请点Advance(进阶设定)
然后点setting(设置)
然后就会打开windows内置的防火墙设置窗口了。
这里,我们选择中间的Exceptions(规则) 选项。
然后我们可以点下面的Add port….(添加端口)来添加VNC所需的一个TCP类型的5900端口和一个UDP类型的5800端口。
请如途中所示进行操作。注意,第一个是名字,可以输入任何有意义的概述即可。第2个端口号码一定要输入正确的端口数字。
RealVNC全攻略教程 - Promise - Promise
如法炮制,完成UDP和TCP设置之后。这里的设置只是让windows XP接受任何跟UDP端口5800和TCP端口5900的网络连接请求。

我们就完成了局域网进行远程操控的设置了。如果你还要进行互联网级别的远程操控,请继续看下去。否则请直接跳过去看客户端的操作。由于我这里用的是被修改过内核的路由器,所以界面可能不太一样。但是其实你可以自己推断个大概然后进行相关设置。

首先,在网络浏览器输入你的路由器HTML界面的网络地址。打开之后,你可以寻找一个叫做 网络转发规则或者如果是英文界面请寻找porforwarding的相关选项。里面应该会出现如图的选项,我们要和上面一样设置这2个TCP和UDP端口。这样每次从互联网外部发送到这个网络地址的时候,路由器会首先接受请求并转发到局域网内部的相关电脑。后面的IP地址即是你电脑的本地IP地址了。一般都是192.xxx.xx.xx或者127.0.0.xx这样的形式。

RealVNC全攻略教程 - Promise - Promise

如图,在最下面的2个就是我设置的和VNC相关的端口转发了。另外,我的路由器还有一个DMZ的软件特性。DMZ的好处就是你不用进行任何特别的设置,直接吧你外网的IP地址和你内网的IP连接上。这样当外部有任何连接请求的时候,路由器都会直接转发到你设定的内网IP地址的那台电脑上了。如图设置即可:

RealVNC全攻略教程 - Promise - Promise

==========================

到此,你就已经完成了所有的关于局域网和互联网的设置了。这个时候,任何一个知道你电脑的VNC管理密码的客户端都可以填入你的互联网的IP地址然后对你的电脑进行操控。

RealVNC全攻略教程 - Promise - Promise

如果你不知道如何获知自己的外网IP地址,你可以打开你的路由器,然后在网络信息之类的标签页可以找到自己的外网IP地址。由于各个路由器界面的信息都不太相同。因此这里就不做任何介绍了。

VNC viwer是VNC软件包中一个唯一独立的软件,可以直接复制到任何一个电脑上使用。充当这远程操作种的客户端的功能。如上图填入ip地址,然后就会自动打开一个窗口,并直接吧服务器端的电脑的屏幕复制过来,显示。 你可以当作自己的电脑一样进行所有操作。

T-mobile Tuesday

It doesn’t matter if you are a T-mobile user or not. You probably have heard of the T-mobile Tuesday things going on lately. It  is really excited and interesting that T-mobile willing to offer something to their royal customers.

On top of that, many people on line are accusing that T-mobile coverage sucks and speed are slow. To be honest, i have only use Tmo,sprint, AT&T and MetroPCs in my life. By far, Tmo has been the best in class in service representataives plus the growths on their technoliges upgrades. If i live on a mobile service provider that has the same service and have not yet to satifsy me and they have not thinking about going out and making any improvents, i think that sucks.

I think i am off topic already. But just want to say T-mobile network does not sucks..The speed are also pretty amazing. I assume T-mobile is not the best, but its service is soso which is a plus to me already..

Wait…I think i am still off topic. So, with this T-mobile Tuesday APP, you basically getting freebies every tuesday. The first week, i redeemed my one share of T-mobile stock, one warcraft movie ticket as well as a free 2 toppting medium pizza. The pizza is soso, but taste not too bad. The warcraft movie i have been excited about can be one year back when i first heard of they are reasing this movie.

I am jost bored….and think about writing something down when i saw those comments when i was looking about t-mobile tuesday APP.. ROFL.

 

Ubuntu 15.10 with Broadcom wireless.

Somehow i always struggling with the broadcom wireless that i have. This is just coincidence that even after two LAPTOP i have changed, both them came with Broadcom wireless module.

The current laptop i have is a Lenovo Z500. Which equiped with Intel core i5 4200M/8GB RAM/120GBSSD/1THDD. Nowaday, you can get a 6th gen core i laptop with something around $600. Though my laptop still runs pretty fast compare to the 6th gen core i gadgets.

This is really off topic. Now today, my problem is to go through the bottleneck of no drivers exsisting in my laptop with my Ubuntu 15.10 to support.

There is a couple simple command i ran to check whats really going on with my wireless.

First, i kicked off with following command to see the result of what network card avaliable. (wireless modules.)

lspci -vnn | grep Network

Then i get the result as below:

02:00.0 Network controller [0280]: Broadcom Corporation BCM43142 802.11b/g/n [14e4:4365] (rev 01)

Noted, above information is very important. In this case, it tells me the correct model and firmware that i have for my broadcom wireless module.

Then, here is the useful command for linux to configue wireless network.

iwconfig

lo no wireless extensions.

enp1s0 no wireless extensions.

The second line could be something similar but it could be different too… (I know some of my co-league would get eth0 for their module.)

Now, we are done with playing around and determining our wireless hardware. Let’s starting with the solutions to fix the wirless driver issue.

Remember the information we get above? The [14e4:4365] (rev 01) is something we would need to deceided which broadcome wireless module firmware we would need for installing with to support the wireless function.

02:00.0 Network controller [0280]: Broadcom Corporation BCM43142 802.11b/g/n [14e4:4365] (rev 01)

Now, lets update the source list with:

sudo apt-get update

Then, we can also updat the ubuntu PCI iDs:

sudo update-pciids

Then below steps by step to install:

sudo apt-get install bcmwl-kernel-source

sudo reboot

Please follow below table to select the correct packages to install from.

PCI.ID 14.04 LTS 15.10+
————————————————————————————
14e4:0576 Special Case #1 UNKNOWN
14e4:4301 firmware-b43-installer firmware-b43-installer
14e4:4306 firmware-b43-installer firmware-b43-installer
14e4:4306 rev 02 firmware-b43-installer firmware-b43-installer
14e4:4306 rev 03 firmware-b43-installer firmware-b43-installer
14e4:4307 firmware-b43-installer firmware-b43-installer
14e4:4311 firmware-b43-installer firmware-b43-installer
14e4:4312 firmware-b43-installer firmware-b43-installer
14e4:4313 firmware-b43-installer firmware-b43-installer
14e4:4315 firmware-b43-installer firmware-b43-installer
14e4:4315 rev 01 firmware-b43-installer / Case #2 UNKNOWN
14e4:4318 firmware-b43-installer firmware-b43-installer
14e4:4318 rev 02 firmware-b43-installer firmware-b43-installer
14e4:4319 firmware-b43-installer firmware-b43-installer
14e4:4320 rev 02 firmware-b43-installer firmware-b43-installer
14e4:4320 rev 03 firmware-b43-installer firmware-b43-installer
14e4:4324 firmware-b43-installer firmware-b43-installer
14e4:4325 firmware-b43-installer firmware-b43-installer
14e4:4328 firmware-b43-installer firmware-b43-installer
14e4:4329 bcmwl-kernel-source bcmwl-kernel-source
14e4:432a bcmwl-kernel-source bcmwl-kernel-source
14e4:432b bcmwl-kernel-source bcmwl-kernel-source
14e4:432c bcmwl-kernel-source bcmwl-kernel-source
14e4:432d bcmwl-kernel-source bcmwl-kernel-source
14e4:4331 firmware-b43-installer firmware-b43-installer
14e4:4335 firmware-b43-installer firmware-b43-installer
14e4:4353 Special Case #1 UNKNOWN
14e4:4353 rev 01 Special Case #1 UNKNOWN
14e4:4357 Special Case #1 UNKNOWN
14e4:4358 bcmwl-kernel-source bcmwl-kernel-source
14e4:4359 bcmwl-kernel-source bcmwl-kernel-source
14e4:4365 bcmwl-kernel-source bcmwl-kernel-source
14e4:4365 rev 01 bcmwl-kernel-source bcmwl-kernel-source
14e4:43a0 bcmwl-kernel-source bcmwl-kernel-source
14e4:43b1 bcmwl-kernel-source bcmwl-kernel-source
14e4:43b1 rev 03 bcmwl-kernel-source bcmwl-kernel-source
14e4:4727 bcmwl-kernel-source bcmwl-kernel-source
14e4:4727 rev 01 bcmwl-kernel-source bcmwl-kernel-source
14e4:a962 firmware-b43-installer firmware-b43-installer

After that the system reboots and hoepfully your wireless card will come up like mine. Otherwise, you can also try below:

sudo modprobe -r b43

sudo modprobe b43

sudo rfkill unblock all

if you have successfully installed the driver, You will happy to see below screens.

2015-12-18 17-34-21屏幕截图2015-12-18 17-42-20屏幕截图

 

 

 

 

Ubuntu stress test.

Command to install:

sudo apt-get install stress

Testing, sameple command:

stress -c 4 -m 5 -d 1
(Explaination:, -c means cpu cores number count that will under stress test. -m means how many memory threads are going to under stress test, -d HDD numbers.)

System configurations:

Intel core i3 2330E/8GB ram/80GB HDD

Tested with above and “stress -c 4 -m 20 -d 1”. Then tried adjusted -m to -m 40 and system crashed and hanged up.

 

Pfft, nice try.

iframe self adjusting height.

I have been doing some research on self adjusting height on some of my site projects. One of the most challenging one for me is that some of my pages using ifrmae to reference from another page. The problem is, it’s not always diplsy correctly the height and width. it’s been exahusting since i am not majoring in CS and coding is a been hard for me. But i finally get this work well.

I have tried jscripts, it never really works. The problem i suspect is because not all browser using the same language translater. IE or most will redefined the iframe value to 0 and reload it, in another words some others will do it accorindly by the abolute values.

Here is a very simeple codes:

<iframe id=’iframe2′ src=”./index_frame.htm” frameborder=”0″ style=”overflow: hidden; height: 100%; width: 100%; position: absolute;” height=”100%” width=”100%”></iframe>

 

By doing so, it will self adjust the iframe size according to the documents and based on the current page size. Works perfrecly for me.

 

Get my logitech unify receiver and keyboard / Mouse to work with my Ubuntu.

So, i reinstall my ubuntu and decided to go with a somewhat new distribution called Elementary OS. Everything works fine except that my Logitech Mouse is not working. It kinds of feel like the mouse is not pair with my Unify receiver.Here is the solution i found and seemd to work like a charm.

First thing first, get your terminal window out and throw in the below codes:
sudo apt-get install git gcc
git clone https://git.lekensteyn.nl/ltunify.git
cd ltunify
make install-home

Screenshot from 2015-02-19 11:43:22

  After that, you should be able to find your ltunify in $Home/bin/ltunify. Next thingyou need to do is redirect to this folder and run:
   ./ltunify pair
  The program will probably ask you to turn on and off of your mouse to pair with your Logitech USB receiver.
  After that, start enjoy your logitech and ubuntu!
  I found it also useful by installing a graphic UI program to manage your unify receiver. This App is call "Solaar".
  Go to your software center. (You can just click the left corner and type in "software" to search for software center.)
  After you launch the software center APP, click on the "Edit" and select "software source". Navigate to "Other software". Click on "Add..." button, then add following ppa:daniel.pavel/solaar
  After doing so, you will need to go to your terminal window and do a "sudo apt-get update". Then you can just type in command "sudo apt-get install solaar".
  Once everything is done. you will be able to search for your "solaar" in your application menu.
  This program will provide you some possible features provided by your unify receiveras well as the mouse battery level. (This could come in handy if you need to know if you possibly need to change your battery soon or if it still can last a while.)

   software sourcesadd software sources

dd (linux) for cloning a new HDD images.

So, just want to make a post and do some notes about a clone HDD images tha ti have been trying to do for a LINUX live that i have for a while.

It’s basically a LINUX live that i ran from a USB drive. I need it to perform some .sh script files and such to process some heavily network traffic and so to meter the LAN port’s healthy status.

Here is the problem, i have this fedora live originally installed to this USB drive for less than 1 GB. After time to time use and some more scripts file written to this USB drive, it has been now growth to gigantic 8GB USB DRIVE!. Although most of fthe files on the USB drive still only occupy the 2GB space. Now, i need to mass reproduced this USB drive to , let’s say 10 more copies. One simple methods that i have been trying to accomplished so far is by copy itself to another same 8GB USB drives. But i have those 4GB USB laying around with no absolutely no use at all. I really and likes to copy the original USB drive to those 4GB drive so i can save some money on buying more bigger size and perhaps more expensive gadgets.

I really want to use dd command which is a powerful yet strong enough to help me finish this target.

First of all, i would like to expertment a little bit and get a little bit of idea about the original USB drive.

By do so, i would need to run comamnd:
sudo fdisk -u -l /dev/sdb
(-u ->this extension would make all bytes in the times of 512 bytes, which  a sector block size. )

This command would allow me to check the layout and size of the USB drive. It could be something similar like below:
/dev/sdb1 5GB
/dev/sdb2 1GB ext
/dev/sdb5 1GB ext

Then we can use the following dd command to make the images:

dd bs=512 count=[max number of “end” result in fdisk command out put] if=/dev/sdb of=image.img

The fdisk command in Linux will identify and calculate the actual size and what ever that partition has been using regardless of it’s types. It wouldn’t matter if it’s a NTFS/FAT32 or even a EXT4 file system.

Above are all practice notes and study plan for cloning a hdd image.