Mobil Mewah

Salah satu sumber Inspirasi.

Tuesday, 17 December 2013

Repair WIndows 7 MBR boot record

I have Windows 7 installation, and try to dual boot with FreeBSD 9. Then problem occurs and fail to create the BSD. and then the Windows 7 cannot boot either. The windows partition is still not touched, but cannot boot to windows. So the question was how to repair the Windows 7 Master Boot Record (MBR) ? After search on google, there are solution to repair it using the windows 7 instalation disk. Here are the step done and documented : 1. Boot...

Wednesday, 4 December 2013

Linux in usb pen drive

Linux is a very powerfull Operating System, and USB pen drive now days are very cheap and affordable with bigger size every year. What you can do with the old USB pen drive which you have since the day 1 you use USB pen drive, let say the 1 GB USB pen drive you have. To small for storing your image and music files right ? But don't keep your USB pen drive in the store room. You can use your old USB to boot a Linux Operating System. Yes you can...

Django error when doing insert

What is the cause of error like this in django + postgresql application : DatabaseError: current transaction is aborted, commands ignored until end of transaction block What happen was I import a production database to my development database. Then there are some south migration that not running locally. I found in forum, the problem maybe with the migration or syncdb. But all already checked, same error still happen when insert to table. Then...

Tuesday, 3 December 2013

Postgresql backup and restore

When doing some development, we need a fast backup and restore for database data in postgresql server. The package provide an easy way to do the backup and restore in 1 command. You only need the username and password + the database name to be working on. Here are the backup command signature : Backup : $pg_dump -U {user-name} {source_db} -f {dumpfile.sql} Restore: $psql -U {user-name} -d {destination_db} -f {dumpfile.sql} So this command is straighforward. I dump a 1000 records in 5 seconds. Also note that the privilege and db owner is follow in the dump file. You must prepare the exact username and database, with no table in it. This...

Monday, 2 December 2013

Postgresql DB Initialization in FreeBSD

Here are some command that used for administrating postgresql database. The OS being use was FreeBSD9.1 with postgresql 8.3  TO enable postgresql service add this in /etc/rc.conf : postgresql_enable=”Yes” postgresql_data=”/usr/local/pgsql/data” postgresql_flags=”-w –s –m fast” postgresql_initdb_flags=”—encoding=utf-8 –lc-collate=C” postgresql_class=”default” To install init db : #/usr/local/etc/rc.d/postgresql initdb We don’t have root user and a user in freebsd, so create one. #su pgsql #createuser dba [set as superuser] Then change password : #psql postgres dba postgres=# ALTER USER dba WITH PASSWORD...

cacti time problem

Yesterday, I have a migration for may cacti NMS server from one Virtual Machine to other Virtual Machine. The problem is that the time error when the VM migrated. This make the graph cannot be updated by the cacti pooler. The time is shifted forward 3 years. If only 24 hours shift, we can just wait for the 24 hours time difference. But 3 years, its unsusable. So the solution is only delete all rrd data and crso bad, create from scratch. This is so bad, as I don't have any backup. Last 1 year performance history data was gone. This is bad with cacti, if only had a protection to stop the rra being updated by the pooler when time is shifting...

Sunday, 1 December 2013

Upgrading Django 1.3 to 1.6 road blocks

So I try to upgrade my project to use Django 1.6 . What I found is some setting that change, and to specific to note in the django Documentation. So I make notes on what have change and need to adjust in my django app configuration. manage.py The manage.py files. Now start from Django 1.4 there was a major change. One of the aim was to overcome the double import file in python. The recommended manage.py are : #!/usr/bin/env python import os import...

Django Version 1.6 release

Recently Django released Django 1.6 release in 6 November 2013. While I am still using Django 1.3 in my production server. Looks so many improvement and site layout arrangement in newer version and make the temptation to try it out. I have the options to upgrade to the newer version. But what makes me stop is there are to many change in the process. Maybe better to use the newer version with new project because the layout is changes to much. In my deployment and development, I use the Reuse application methodology. So i hope the change is only in the project layout, but the app layout is still the same. What I encounter in Django 1.3 lack...

Sunday, 20 October 2013

Links to research data

I made this list for my own purpose to get research and paper information i found in Internet. Hope usefull for you who found this page : http://ageconsearch.umn....

Friday, 4 October 2013

Battle of the Year 2013 The Movie

Today i just notice about a movie about dance sport competition in one of online video website and watch the movie trailer. It is interesting because in the movie, the story about the sport, the coach and the team. This what make me interested to watch the movie at first place " A good coach can take his team to championship " But this  "A great coach can get any team in any sports to the TOP" This something that greatness produce, and i think many things i can learn from this movie and also it is entertaining to see a dance competition and the choreographer . It makes me fell some spirits to do more in daily life. So just check...

Tuesday, 17 September 2013

Get Mobile user access exchange server

Every administrator of exchange server happy with the GUI microsoft provided, but still command line is the best and efective way to get information from exchange. We can scripting and automate the way we get information and dump it to a file as we like. Come the Power Shell for exchange to the rescue. We can use Power Shell to query the exchange server to get any information we need which already provided. Here we need to get the exchange user which using mobile device to access their inbox. The simple command are : Get-Mailbox -ResultSize:Unlimited | ForEach {Get-ActiveSyncDeviceStatistics -Mailbox:$_.Identity} | Where {$_.LastSuccessSync...

Tuesday, 10 September 2013

Optimize squid caching Hit Rate

To optimize squid cache and get a bigger cache Hit ratio , we need to tune some configuration. The default configuration just run without optimization in cache usage and bandwith saving. First, if our target is have a bandwidth saving, we need to configure the cache_replacement config. The options are : Least Recently Used (LRU) This is the default method use by squid for cache management. Squid starts by removing the cached objects that are oldest (since the last HIT). The LRU policy utilizes the list data structure, but there is also a heap-based implementation of LRU known as heap lru. Greedy Dual Size Frequency (GDSF) GDSF (heap GDSF)...

Get User in Active Directory geek way

In Windows Active Directory there are many ways to manage the data. The easiest way is use the Gui console provided by Microsoft and had been a friend to many of Windows Administrator. But how if we need to get many of the user in single command ? Here are the command line still the most favorite choice of smart and Lazy administrator. Here are some command to interact with Active Directory using Dsquery command. Just drop to MSDos box and query it. To get all Group in Active Directory : dsquery group -limit 10000 > groups.csv To get all Users in Active Directory : dsquery user -limit 10000 > users.csv To get Users which  not...

Tuesday, 27 August 2013

Query disabled user in Active Directory

Some times we need to use programing to generate something more faster, especially if you handling more than 100 records of data. This time i need to query user that are disabled in Active Directory. Sure you can see it by search in Active Directory control pane, but i need it to be exported in csv so i can handle it in excell format for futher processing. So here are the script to know who is disabled in Active directory and save it to a csv file. Const ADS_UF_ACCOUNTDISABLE = 2 Set objConnection = CreateObject("ADODB.Connection") objConnection.Open "Provider=ADsDSOObject;" Set objCommand = CreateObject("ADODB.Command") objCommand.ActiveConnection...

Sunday, 11 August 2013

Options list with angular.ui bootstrap

I recently need to generate an options list, which is queried before from database. This is common practice in web / application development, where system provide the value for the options which is created by admin of the application. So in angularJS all purely javascript, we can use for loop, but takes time. We are smart developer right? Here how I did this using angular.ui.bootstrap component . We assume the data will be : var categories = ['red','green','blue']; The data will be generated from your database. How to generate it using REST, is out of the topic for now. And in the view :   <select name="label" id="label" data-ng-model="article.label"...

Monday, 5 August 2013

Windows Domain controller Demotion

I have a windows 2003 Domain controller. I have 3 of the DC from previous installation. Now I need to remove this domain, and I think need to do some clean up with proper way, cannot just shutdown the Domain controller. This is because the Domain Controller have child domain and it getting harder to remove. I documenting the process in here for reference. First in windows 2003 Domain we can have 5 role in 1 server or it called FSMO role. We need to check it belongs to which server and make sure it transfered correctly to other server before it will be the last server to remove. First to check the role server have run this command : c:\>netdom...

NodeJS application Deployment

NPM Logo Recently I prepare to deploy a NodeJS application for server side application. There are some dependency and prerequisite software to be installed, like mongoose lib, ExpressJS lib, and other lib in NodeJS environment. To make this deployment easy, NodeJS come with NPM, which can install all the needed library from a single file called package.json . We just list all the dependency needed by the application, in development and in production...

Sunday, 4 August 2013

AngularJS and ExpressJS Basic Auth

So I have successfully implement the Basic Authentication method with AngularJS as frontend , and using ExpressJS as my REST service provider. Lets dig in the specification first which are : The client will have to sent the Basic authentication header in every XHR request The XHR request will be using the factory $resource in AngularJS The REST service will need to check the Authentication header in every request If no authentication header available, it will response with 401 code If the authentication header available, check against user database, if not match response with 401 code If credential match, continue with next operation The check...

Saturday, 3 August 2013

Authentication in REST Service

Today I try to make authentication working in accessing REST services. I use ExpressJS to server the REST service, of course with NodeJS. There are some options I found to be interesting and to be considered and I will share and Document it in here. Hope this will be useful for other programmers out there. There are 2 options I explore to make authentication : Include the authentication information in the query url.For example, http://api.myservice.com/api/v1/tweet/?user=themaster&apikey=9294023984987249This is the easiest way to generate in any application and is common in all web application Include the authentication information in...

Cassandra DB for High Availability

Cassandra DB Logo I am looking for a database which will eliminate headache when the data growing and when need to scale the server. I want to be able do scaling Horizontal easily and with any size of physical server. Also want to have added capacity as I add new database node to the cluster. Is this possible with old school relational database like Oracle, MSSQL, MYSQL, PostgreSQL . From my experience even using vendor supported database, the...

Friday, 2 August 2013

Using WMI In windows environment

In windows, there are some tools provided by Microsoft called Windows Management Instrumentation (WMI) . Its a service which included in windows server to access the magic in the server, like processor, disk status, network status, OS, software installed and other low level information to windows. It is available in Windows XP, windows 7 , Windows server 2003 and up. But in windows server 2003 the WMI is not installed by default. You should install the WMI provider. To install manually go to control panel >> add remove programs >> add/remove windows component >> management and monitoring tools >> WMI Windows Installer...

Thursday, 1 August 2013

Do we need caching in AngularJS

Angular JS Do we need caching in Angular JS ? Caching in a Web based application can dramatically improve the performance and application loading. But it also hard to to invalidation. With Ajax application like AngularJS, I thinking about do we need cache the ajax response from REST api backend. After some reading and search about web caching, from Web Caching for the credits, I conclude that no need to do the cache in tha application logic....

Wednesday, 31 July 2013

Form Validation in AngularJS

Every Web application will need a sort of validation before user enter submit button. This usually makes a round trip travel of the data to the server. For example user fill form, then submit the form to the server. After checking in server, there were errors and the form sent back to the user with error message for the user to fix. This give an unnecessary round trip request to the application server. In AngularJS, we minimize the roundtrip request to the server, because AngularJS tend to be Ajax application with REST api backend. We validate the form input from the user before submitted to the server. But remember, we cannot depends on client...

Monday, 29 July 2013

VIM Editor for productive programmer

If you are in linux world and do some basic hacks, the command line you will have by default will be Vi . Vi Editor There are some command line which more extensible and many plugin, called VIM. This editor not just text editor. In first attempt you will see this VIM application is only simple notepad editor in windows. This is the basic VIM without any plugin loaded. You will like VIM later on. What a programmer want is of course some smart...

Tooltip on Twitter Bootstrap

Just now I managed to use Tooltip on Twitter Bootstrap theme for my website. I follow just the template in the example     <a href="#" rel="tooltip" title="first tooltip">hover over me</a> But nothing happend as expected. All the file included there, the bootstrap.js and the bootstrap.css with complete feature in it. Check inside the bootstrap.css, there are entry for tooltip class. Also in the bootstrap.js there are handler for Tooltip. Searching around via google, i found out that Bootstrap ToolTip feature cannot be used just like that, you need to add some invocation in the head, when document.ready function. Here...

Sunday, 28 July 2013

How to use syntax Highlighter in blogger

If you are a Developer and do blogging and post your code inside your blog, you want to have it display nicely and also it will help others see your post with smiling face. There are some utility for this, called syntax highlighter. We can use it in blogger, just insert some javascript in your HTML Head in your blogger template. The code base on JavaScript and almost every blog I found use it. Here are the code to add : SyntaxHighlighter.config.bloggerMode = true; SyntaxHighlighter.all(); The main file is the shCore.css , shCore.js Then in your code just add <pre class="brush: js"></pre> And make sure the javascript...

Improve web application loading

So you have a web application, and it contains HTML in it. The size for each page around 300kb or some have 800kb .Whatever the size your application server generate dynamically, it needs time to load, consume network bandwidth in server, memory usage in server, also consume resource in routers, firewalls, client modem, client CPU and memory and so on. You can say for client is not to big. They have cache locally , every web browser now have local cache. But still the browser need to check with the web server if there are any change in the content before load it from the cache. It still consume resource. Now shift to the server point of...

Saturday, 27 July 2013

Angular JS for Single Page Application

Recently I came up to see a front end framework , which many of them in the net you can find. The reason for that is i need a framework to build a web application with ajax technology for front end and also backend with ease. Then i find many of the framework and learn some of them. I found BackboneJS is interesting, but many coding with MVC framework type coding. Then i also hear AngularJS which developed by google developer there, obviously by many smart people. AngularJS also provide MVC standart, but they said in their documentation that AngularJS is MV* type of framework. And after reading many resources in the web and a Book,...

Page 1 of 2512345Next
Twitter Delicious Facebook Digg Stumbleupon Favorites More