Posts

Welcome T480 and Multiple OS, :(

Image
Note for setting up Kubuntu 18.04 then Window7 My laptop(T480) current status is setup with Kubuntu without UEFI enable. Until I find the way to do that I will leave it like this. First, I setup Kubuntu with this layout 3 partitions (all /dev/sda) (pri)/dev/sda1 as /root (log)/dev/sda2 /dev/sda5 as /home (pri)/dev/sda3 as swap Got 1 space left, size around 450gb, leave it unformatt. Then I got  usb (window7 extracted) plug, then reboot the machine. Let window installer format and use that space. When It's done, It's reboot. Then I come to d.step. My laptop can boot only Window7. Here are the rescue steps Find one Linux extracted USB (probaby made from Unetbootin) Boot with it (I am in LiveCD mode), then grab boot-repair from some of instructions from site below https://help.ubuntu.com/community/Boot-Repair Do what's site guide, then I got Grub menu and Kubuntu back. But window gone. It's ok, boot laptop to Kubuntu, setup boot-repair by ...

Changing postgres password and warning

ORIGINAL from https://serverfault.com/questions/110154/whats-the-default-superuser-username-password-for-postgres-after-a-new-install CAUTION  The answer about changing the UNIX password for "postgres" through "$ sudo passwd postgres" is not preferred, and can even be  DANGEROUS ! This is why: By default, the UNIX account "postgres" is locked, which means it cannot be logged in using a password. If you use "sudo passwd postgres", the account is immediately unlocked. Worse, if you set the password to something weak, like "postgres", then you are exposed to a great security danger. For example, there are a number of bots out there trying the username/password combo "postgres/postgres" to log into your UNIX system. What you should do is follow  Chris James 's answer: sudo -u postgres psql postgres # \password postgres Enter new password: To explain it a little bit. There are usually two default ways to login to...
Hi Everyone :) I just beginning new post in new year with Xubuntu fresh installed on X260. A bit of problems around. This post will relate to one problem I found recently. Problem:   I cannot bring bring `brightness` back after return from suspend. Summarize solutions:   1.1. Create this file by command `sudo touch /usr/share/X11/xorg.conf.d/20-intel.conf`   1.2. Add this to file Section "Device"         Identifier  "card0"         Driver      "intel"         Option      "Backlight"  "intel_backlight"         BusID       "PCI:0:2:0" EndSection   1.3. Restart or may be logout and login   2.1. Edit this file by command `sudo vi /etc/default/grub`   2.2. Modify previous to with this GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=Linux apci_backlight=vendor"   2.3. We should restart, i guess Fi...

Cool bash command for summary bot visited

I just found quite cool bash combination cat test.log | awk -F\" '{print $6}' | sort | uniq -c | sort -n from this  http://www.blogtips.org/web-crawlers-love-the-good-but-kill-the-bad-and-the-ugly/ I try it with nginx log, the result is look good. :)

Reupload stuff to S3 with aws cli

Hi, my friend.     Today I have done some stuff using aws cli. It's quite a good tools beside python+boto. My task in this period is about devops+dev :p. So currently I created some image migrate script in python. It is for reprocess an images using Imagemagick. Then it need to be upload to S3. The accident is about I forget to assign ACL for all images before upload to S3. User cannot see ours images. I try some stuff from google then I realize that I never try linux:touch command before. And It works. I use command >> aws s3 sync . s3://mybucket --dryrun to check if tools can reupload for me. :) Luck is on my side now!!!. So I just >> find . -name 'xxx.yyy' | xargs touch  and >> aws s3 sync . s3://mybucket --acl public-read Finally. Yeah, Shit Done!!!! Next Post I will describe about my python script + imagemagick

Create new user with sudo permission

Usecase: I install linux without GUI ( so it didn't provide ubuntu user ). If I want to have another with sudo permission. Let's try this be root or user with root permission >> adduser sudo because in sudoer file, said Any user in group sudo, will have permission to use sudo command ref: http://askubuntu.com/questions/7477/how-can-i-add-a-new-user-as-sudoer-using-the-command-line

Release with exrm in Elixir

Hi All :) I'm using exrm (https://github.com/bitwalker/exrm) for releasing process. It's quite nice library. Even I don't actually know what it done behind (digging it now). Notice that some important issue is about if your application cannot start because some thing or function is invalid or cannot not load but you sure that you put it in mix.exs in deps list. So this https://exrm.readme.io/docs/common-issues will inform us to put it in mix.exs in applications list, too. Even i don't understand why, because in elixir's doc of mix's topic said if app implemented by use "Application" behaviour. They should be put in mix.exs application list. But chronos's code doesn't seem to implement with "Application" behaviour. Anyway i tried put it in that list, and its work!!.

The beginning of my's Elixir

Introduction I just start new job. All work I assigned about elixir. Currently, i'm working on replacing rail's service with elixir( use phoenix framework as api endpoint ). It's quite good now because I came from python's background. Elixir 's Installation - We need erlang installed [linux] sudo apt-get install erlang [osx] brew install erlang Then [linux] Goto https://www.erlang-solutions.com/downloads/download-elixir, you may download deb file for ubuntu or whatever distro you have. [osx] brew install elixir [ping me, if i'm wrong :p] If you come to this line, let's >> mix help mix                   # Run the default task (current: mix run) mix app.start         # Start all registered apps mix archive           # List all archives mix archive.build     # Archive this project into a .ez file mix archive.install   # Install an archive locally mix archi...

Using "wget" to check web server status

Please use this # wget -O - | grep -O : indicate output filename - : send content to std output ref www.terminalinflection.com/using-wget-to-test-web-server-connectivity/

Backup my kubuntu 14.10 settings

Before I get other machine, I want to thank to my x230, you're so cool!!! Style widget style : QtCurve Icon theme : numix circle Font liberation use anti-aliasing : enabled use sub-pixel  rendering : RGB hinting-style : slight Window Decorations QtCurve Desktop Theme Glaze

Connect Oracle from Django 1.7 (Linux)

Hi, today I'm gonna create new Oracle's related Project with Django 1.7.  My setup is  Kubuntu 14.10 First thing I will have to have installed oracle-client. You should download these files below from oracle website oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm oracle-instantclient12.1-jdbc-12.1.0.2.0-1.x86_64.rpm oracle-instantclient12.1-odbc-12.1.0.2.0-1.x86_64.rpm oracle-instantclient12.1-tools-12.1.0.2.0-1.x86_64.rpm oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm Then we would use 'alien', which is linux application that can convert rpm to deb. By doing this >>> sudo alien *.rpm Then use dpkg install them all >>> sudo dpkg -i *.deb Next , edit your bashrc file, by add export ORACLE_HOME=/usr/lib/oracle/12.1/client64 PATH=$PATH:$ORACLE_HOME/bin export LD_LIBRARY_PATH=$ORACLE_HOME/lib Create virtuaenv or pip to your env >>...

Setup environment for python developer in windows :)

Hi my friend :)     Sometime I may have a change to develop something in window, this is a guide to get python development up! Actually I just found powershell, interesting!!! http://www.tylerbutler.com/2012/05/how-to-install-python-pip-and-virtualenv-on-windows-with-powershell/ https://pip.pypa.io/en/latest/installing.html

Try ubuntu 14.04 on my old macbook pro late 2009 (Part2)

Try ubuntu 14.04 on my old macbook pro late 2009 (Part2) I trying to do something to make touchpad feel same as in OSX This is one I can find Section "InputClass"         Identifier "touchpad catchall"         Driver "synaptics"         MatchIsTouchpad "on"         Option "FingerHigh" "10"         Option "FingerLow" "1"         Option "TapAndDragGesture" "off"         Option "PalmDetect" "on" EndSection Section "InputClass"     Identifier         "Touchpad"     Driver             "synaptics"     MatchIsTouchpad    "on"     Option         "ClickFinger3" "2"     Option         "HorizTwoFin...

Try ubuntu 14.04 on my old macbook pro late 2009 (Part1)

Aha, This is what I dream for long time to get Linux on MacBookPro. This is what I have done Start with DVD Ubuntu 14.04 I found a loud noise of fan, so I did     sudo apt-get install lm-sensors fancontrol     sudo pwmconfig (don't know what this command did, but I notice nothing)     sudo sensors-detect (last step, did allow it to auto load) I found that I can't adjust brightness so I did     edit /etc/rc.local         put this             echo '1' > /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness             echo '5' > /sys/class/backlight/apple_backlight/brightness     for 2 steps above, I'm not sure if they work or not but I did more         sudo nvidia-xconfig ( got invalid xorg.conf )  ...

Cannot change brightness setting using function button or the brightness

I'm got new machine from new workplace, It's HP Probook. It's look quite good but I have got a problem about changing screen brightness doesn't work. So I google and found this https://askubuntu.com/questions/332657/cannot-change-brightness-setting-using-function-buttons-or-using-the-brightness, This blog put me through that problem. So this is my note sudo vi /etc/default/grub for this var GRUB_CMDLINE_LINUX="", set value "acpi_backlight=vendor" sudo update-grub restart then , yeh, many thanks for https://askubuntu.com/users/183206/aaditya-bagga

9 Awesome Google features we should use [memo]

9 Awesome Google features we should use Google Flight Search usage : "flight from to Google Public Data Explorer usage : "unemployment in the u.s." Google Translate usage : "translate to " Google Nutrition Comparison Search usage : "compare broccolli and asparagus" Google Definition usage : "define " Google Convertion usage : "convert eight ounces to cups" Google nGrams : We can search how many times specific words occur. Google Sky Exclude Search Term usage : "puppies -sales" ; you don't want sites that sales in the result. Reference  and thank to (Kim Komando - www.komando.com)

Using git with my case #1

Using git with my case #1 Display branch >>> git branch -a -v >>> git branch -r ; display remote branches >>> git remote update origin --prune Delete branch >>> git branch -d ; delete local branch >>> git push origin : ; delete remote after delete local branch >>> git push origin --delete ; delete remote Get data from remote ( origin ) >>> git fetch origin ; get info of remote branch to our local machine note*     git pull do         1. git fetch         2. git merge Diff local with remote or others >>> git diff >>> git diff ; diff local branch with remote branch Fetching >> git fetch ; fetch all branches heads >> git fetch --tags ; fetch all tags Start Hotfix 1. Check latest tag     >> git fetch --tags 2. Start hotfix tags     >> git tags ; check latest tags     >...

Think of using Xvfb

Xvfb - X Virtual Frame Buffer Xvfb  is an X server that can run on machines with no display hardware and no physical input devices. It emulates a dumb framebuffer using virtual memory. ผมค้นพบโปรแกรมนี้ เนื่องจากความต้องการที่จะทำ UI Test ซึ่งเป็นส่วนประกอบย่อยของระบบ Continuour Integration ที่ผมพัฒนาอยู่ (ตอนที่เขียนบทความนี้ โครงงานที่ทำอยู่หันไปใช้ phantomjs แล้ว :P ) ผมเห็นความเป็นไปได้ในการเอาโปรแกรมนี้ไปใช้ซึ่งมีคนเอาไปทำแล้วอย่างเช่น plugin ที่ใช้ใน jenskin (CI). และแน่นอนผมคาดว่ามันจะสามารถทำงานกับ selenium ทีเวลาที่ตัว selenium ทำงานจะเปิดหน้า webbrowser ขึ้นมา สำหรับงานเทสระบบเว็ป โปรแกรมนี้น่าจะเป็นอะไรที่เข้าทางเลยทีเดียว :) Reference xvfb -> http://www.x.org/archive/X11R7.7/doc/man/man1/Xvfb.1.xhtml buffer - > http://en.wikipedia.org/wiki/Buffer_(computer_science) frame buffer -> http://en.wikipedia.org/wiki/Framebuffer jenskin-xvfb-plugin -> https://wiki.jenkins-ci.org/display/JENKINS/Xvfb+Plugin

Create sequence with zero padding

Hmm I got to pull series of git source from 01-13. But I'm too lazy so I googled then I found program `seq` I don't know it much but it can >>> seq 1 10 1 2 3 4 5 6 7 8 9 10 >>> seq -w 1 10 01 02 03 04 05 06 07 08 09 10 >>> seq -w 01 10 01 02 03 04 05 06 07 08 09 10 Aha, So I see the light!! >> for id in `seq -w 01 13`; do git pull XXXXX$id; done; Yeh,! Many thank to links below!! :) http://stackoverflow.com/questions/6446672/generating-huge-lists-of-numbers http://stackoverflow.com/questions/8789729/zero-padding-in-bash

Using hexdump to check special chars on files

When you suspect on some word that will hide something inside. And I already have compare file. First thing I will try >>> diff file1 file2 Then I know more which word, so I >>> grep file1 And I'm not sure what wrong with it , I will >>> grep file1 | hexdump -C got thing like 00000000  48 65 6c 6c 6f 20 48 6f  77 20 61 72 65 20 79 6f  |Hello How are yo| 00000010  75 20 74 6f 64 61 79 0a  0a                       |u today..| 00000019 But I think it useless, I decide to >>> grep file1 | hexdump -c got this 0000000   H   e   l   l   o       H   o   w       a   r   e       y   o 0000010   u       t   o   d   a   y  \n  \n                           ...