Do you have an experience, that Ubuntu able to broadcast its hostname to Windows network where other Linux OS have issues on it?
You googled for remedy.
You edited ifcfg-xxx, dhclient-xxx.conf, /etc/hostname.
You tried nsupdate.
But, nothing worked and frustrates you.
Changing hostname in Ubuntu alone affects immediately.
You start to think that you should have used Ubuntu...
Well, here is my solving method based on both CentOS 6 / 7.
(Do it with your own responsibility)
After the OS installation with "Web Server" package.
You install SAMBA.
# yum install samba
Next, you rename your hostname.
# hostname my-centos
Start the SAMBA NMB Daemon.
# service nmb start
There, you should be able to ping "my-centos" from Windows.
If you still unable to get them, it might be SELinux / iptables issue.
It's not recommended but you can disable it.
# setenforce 0
# iptables -F
There. it should be working nicely right now.
Have a nice day =)
Thursday, 21 August 2014
Tuesday, 22 January 2013
Recent update 2013/01/23
It's late but, Happy New Year :D
Recently have really busy on my job.
Because of it, I was unable to do my personal stuff.
So, it end up AliceSoft released a Browser type ADV before I released my B-ADV. orz
Well that ADV is now closed though, it turned me up to revise my B-ADV.
So, my current status is on developing reB-ADV(revised B-ADV). Bit by bit though...
I just really hope that I able to release before any similiar stuff released.
Well in developing reB-ADV, I replaced Audio Data API with Web Audio API.
Have been playing with the new toy, but still unclear how to pan / balance the channel.
The Google's Pan/Reverb demo works good and when I try to mimic it, it just doesn't come out right. Sigh.
Well, hope to share you guys with anything new or anything inspires me.
Have a nice day :)
(It looks like my postfix + dovecot setup is the most popular post in my blog, hmm)
Recently have really busy on my job.
Because of it, I was unable to do my personal stuff.
So, it end up AliceSoft released a Browser type ADV before I released my B-ADV. orz
Well that ADV is now closed though, it turned me up to revise my B-ADV.
So, my current status is on developing reB-ADV(revised B-ADV). Bit by bit though...
I just really hope that I able to release before any similiar stuff released.
Well in developing reB-ADV, I replaced Audio Data API with Web Audio API.
Have been playing with the new toy, but still unclear how to pan / balance the channel.
The Google's Pan/Reverb demo works good and when I try to mimic it, it just doesn't come out right. Sigh.
Well, hope to share you guys with anything new or anything inspires me.
Have a nice day :)
(It looks like my postfix + dovecot setup is the most popular post in my blog, hmm)
Thursday, 4 October 2012
CodeIgniter + Memcached on CentOS 6.x
*This setup uses PHP 5.4.x from remi repository, on CentOS 6.3*
Do you have trouble to get Memcached working on CodeIgniter?
Well, I do.
Recently, I have been researching and playing around with CodeIgniter.
After having some fun with experimenting page building and DB access,
Data Caching was my next "toy".
But things doesn't goes well.
So I'm writing this down as a memo for myself too.
1. You need to have memcached.php under the application/config/ directory.
* NOTE: CodeIgniter v2.x does not contain the file.
* Refer: http://codeigniter.com/forums/viewthread/180005/#926666
* The config's sample also provided in the thread.
2. You need to get libmemcached and libmemcached-devel from the correct repository.
* I get my PHP 5.4 from remi repository, so I need to get it from remi repository too.
* If you do not get the correct library, you won't be able to continue the next step.
3. Install php memcached module, and add it into php.ini
* Just run
* In order to build/install, you will need gcc and gcc-c++.
4. Most importantly, install memcached.
* In CentOS 6.x, memcached is normally provided in the default repository.
* If you are referring this setup and installing it on CentOS 5.x, you will need RPMForge repository to get the job done.
5. After everything from above are finished, you are ready to go.
* get the memcached daemon run and restart your apache/httpd server.
6. In CodeIgniter, Use the code below to test if your memcached works
Have a nice day. :D
Do you have trouble to get Memcached working on CodeIgniter?
Well, I do.
Recently, I have been researching and playing around with CodeIgniter.
After having some fun with experimenting page building and DB access,
Data Caching was my next "toy".
But things doesn't goes well.
So I'm writing this down as a memo for myself too.
1. You need to have memcached.php under the application/config/ directory.
* NOTE: CodeIgniter v2.x does not contain the file.
* Refer: http://codeigniter.com/forums/viewthread/180005/#926666
* The config's sample also provided in the thread.
2. You need to get libmemcached and libmemcached-devel from the correct repository.
* I get my PHP 5.4 from remi repository, so I need to get it from remi repository too.
* If you do not get the correct library, you won't be able to continue the next step.
3. Install php memcached module, and add it into php.ini
* Just run
#pecl install memcached, after installation just edit php.ini* In order to build/install, you will need gcc and gcc-c++.
4. Most importantly, install memcached.
* In CentOS 6.x, memcached is normally provided in the default repository.
* If you are referring this setup and installing it on CentOS 5.x, you will need RPMForge repository to get the job done.
5. After everything from above are finished, you are ready to go.
* get the memcached daemon run and restart your apache/httpd server.
6. In CodeIgniter, Use the code below to test if your memcached works
// $this->load->driver('cache', array('adapter' => 'memcached'));
// var_dump($this->cache->memcached->is_supported());
* This should return you boolean(true) and you can use memcached as your data caching.Have a nice day. :D
Wednesday, 19 September 2012
iPhone emoji issues on MySQL + PHP
Today I had some troubles while storing text from iPhone device to MySQL.
I did some digging and found that the iPhone's emoji is suspicious.
PHP threw some error with byte characters in it.
After some time googling around,
found that the iphone emojis are mostly 4 bytes character,
and MySQL will only able to store the data if its in UTF84mb format.
What a tragedy.
There are 2 cures for this issue.
1. Upgrade your MySQL server and set the character to UTF84mb.
2. Remove the 4 byte character.
Referred: http://kohkimakimoto.hatenablog.com/entry/2012/02/04/103457
Sigh, I hate emojis.
I did some digging and found that the iPhone's emoji is suspicious.
PHP threw some error with byte characters in it.
After some time googling around,
found that the iphone emojis are mostly 4 bytes character,
and MySQL will only able to store the data if its in UTF84mb format.
What a tragedy.
There are 2 cures for this issue.
1. Upgrade your MySQL server and set the character to UTF84mb.
2. Remove the 4 byte character.
$cleanStrings = preg_replace('/[\xF0-\xF7][\x80-\xBF][\x80-\xBF][\x80-\xBF]/', '', $fourByteString);
Referred: http://kohkimakimoto.hatenablog.com/entry/2012/02/04/103457
Sigh, I hate emojis.
Thursday, 2 August 2012
Scrollable fixed contents with HTML and CSS, with some jQuery
Do you have a task to make a scrollable fixed element where the main content is behind it?
Plus, it must contain native application-like animation?
AND IT MUST BE IN HTML + CSS?
Well, I just figured it out a way for it.
I made this when my colleague asked me whether HTML + CSS able to scroll fixed element while I thinking about the "log part" of my BADV-project template.
What came out is this.
(Notet that it's just a rought sample. Android / iOS may react different)
Well, it's a dirty work and all work-in-progress code / comments are inside.
(Note that some css values were modified to suit into this blog. Example, position: fixed to absolute)
Original code:
http://dev.k2-rnd.com/samples/slide.zip
Plus, it must contain native application-like animation?
AND IT MUST BE IN HTML + CSS?
Well, I just figured it out a way for it.
I made this when my colleague asked me whether HTML + CSS able to scroll fixed element while I thinking about the "log part" of my BADV-project template.
What came out is this.
(Notet that it's just a rought sample. Android / iOS may react different)
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
content
MENU!
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
subcontent
Well, it's a dirty work and all work-in-progress code / comments are inside.
(Note that some css values were modified to suit into this blog. Example, position: fixed to absolute)
Original code:
http://dev.k2-rnd.com/samples/slide.zip
Sunday, 29 July 2012
SquirrelMail issue and fix (Message Filtering and Multibyte Character display, for CentOS)
I'm happy with SquirrelMail even since I installed it.
(Check my previous post on postfix and dovecot)
Everything is working fine and no big deal really occured.
Until...
01 Start to manage Log-type Messages.
02 Start to compose / receiving multibyte messages...
Issue 01
It was not quite a problem when you think that you can just filter the message,
and move them into a specified folder.
But the problem is "Message Filter" is DISABLED in default.
Search through the web found the solution.
(Only available for the latest version of SquirrelMail?)
If you installed your SquirrelMail through EPEL-repo, you just need to execute:
Now you will have "Message Filtering" on the Option Menu.
End of Issue 01.
Issue 02
Well, if you only compose your message using ONLY Alphabets.
Plus, if you do not have any contact that sents you multibyte character included messages.
This might not be an issue for you.
You are unable to view the message properly due to decoding issue. (everything is garbled)
Note that, if you switched your Display Option to that specified language,
you able to view the decoded message properly.
But in my case, I want my SquirrelMail default language as English.
As well I receives Japanese and Chinese messages.
Google's search result lead me to a solution,
where you need to modify the current source. (Japanese site, which says i8n.php is buggy, etc...)
Which i think is not a good idea to do so.
I continue to search for the clue until I fed up and decided to browse through the official site.
Well, what did you know. There is a miracle cure in the download section.
What you need to do is:
- Download "Extra Decoding Library" from the official site's download section.
- Extract the package.
- Copy and Replace the SquirrelMail's function/decode/ directory.
** You will need php-recode for "Extra Decoding Library". Skip this step if you already have it.
Linux command:
01. Download.
02. Extract and access directory.
03. Copy file (execute install, you will be prompted for SquirrelMail's directory: /usr/share/squirrelmail/)
04. Check whether files are copied successfully.
05. Restart httpd.(Might not needed?)
And there you go.
You can now compose / receive multibyte message with no problem.
... Unless some new encoding method added ...
End of Issue 02.
(Check my previous post on postfix and dovecot)
Everything is working fine and no big deal really occured.
Until...
01 Start to manage Log-type Messages.
02 Start to compose / receiving multibyte messages...
Issue 01
It was not quite a problem when you think that you can just filter the message,
and move them into a specified folder.
But the problem is "Message Filter" is DISABLED in default.
Search through the web found the solution.
(Only available for the latest version of SquirrelMail?)
If you installed your SquirrelMail through EPEL-repo, you just need to execute:
# /usr/share/squirrelmail/config/conf.plSelect "Plugin", Select "filter", Save your configuration and quit.
Now you will have "Message Filtering" on the Option Menu.
End of Issue 01.
Issue 02
Well, if you only compose your message using ONLY Alphabets.
Plus, if you do not have any contact that sents you multibyte character included messages.
This might not be an issue for you.
You are unable to view the message properly due to decoding issue. (everything is garbled)
Note that, if you switched your Display Option to that specified language,
you able to view the decoded message properly.
But in my case, I want my SquirrelMail default language as English.
As well I receives Japanese and Chinese messages.
Google's search result lead me to a solution,
where you need to modify the current source. (Japanese site, which says i8n.php is buggy, etc...)
Which i think is not a good idea to do so.
I continue to search for the clue until I fed up and decided to browse through the official site.
Well, what did you know. There is a miracle cure in the download section.
What you need to do is:
- Download "Extra Decoding Library" from the official site's download section.
- Extract the package.
- Copy and Replace the SquirrelMail's function/decode/ directory.
** You will need php-recode for "Extra Decoding Library". Skip this step if you already have it.
# yum install php-recode
Linux command:
01. Download.
# wget http://squirrelmail.org/countdl.php?fileurl=http%3A%2F%2Fprdownloads.sourceforge.net%2Fsquirrelmail%2Fsquirrelmail-decode-1.2.tar.gz
02. Extract and access directory.
# tar xzvf squirrelmail-decode-1.2.tar.gz
# cd squirrelmail-decode-1.2
03. Copy file (execute install, you will be prompted for SquirrelMail's directory: /usr/share/squirrelmail/)
# ./install
04. Check whether files are copied successfully.
# ll /usr/share/squirrelmail/functions/decode/
05. Restart httpd.(Might not needed?)
# service httpd graceful
And there you go.
You can now compose / receive multibyte message with no problem.
... Unless some new encoding method added ...
End of Issue 02.
Tuesday, 24 July 2012
How to locate yourself using HTML5 Geolocation (obtain current location's latitue/longtitude)
To locate your current position.
What you need is just the following JavaScript code.
Yeap, thats all what you need to get your current location's latitude and longtitude.
And it's works on ALMOST all browsers. (Argh, android device before v2.1 not supported.)
Mind that, the latitude and longtitude obtained it's not 100% accurate.
It depends on ISP and carrier for the accuracy.
Example, PC browser that access through wired line ISP would obtain the nearest relay station's location. Where the wi-fi user gets a closer match.
What you need is just the following JavaScript code.
var coordinates;
function updatePosition(position) {
var lat = position.coords.latitude;
var lon = position.coords.longitude;
coordinates = [lat, lon];
}
function handleError(positionError) {
alert('Attempt to get location failed: ' + positionError.message);
}
var gps = navigator.geolocation;
gps.getCurrentPosition(updatePosition, handleError);
alert(coordinates);
Yeap, thats all what you need to get your current location's latitude and longtitude.
And it's works on ALMOST all browsers. (Argh, android device before v2.1 not supported.)
Mind that, the latitude and longtitude obtained it's not 100% accurate.
It depends on ISP and carrier for the accuracy.
Example, PC browser that access through wired line ISP would obtain the nearest relay station's location. Where the wi-fi user gets a closer match.
Subscribe to:
Posts (Atom)