Sunday, January 15, 2017

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.

  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"
  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

Finally, I still don't know if it work, but hey, right now it's fine for me

Monday, August 1, 2016

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

I try it with nginx log, the result is look good. :)

Thursday, March 24, 2016

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 
>> aws s3 sync . s3://mybucket --acl public-read
Finally. Yeah, Shit Done!!!!

Next Post I will describe about my python script + imagemagick

Friday, October 2, 2015

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

Wednesday, September 2, 2015

Release with exrm in Elixir

Hi All :)

I'm using 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 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

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


[linux] Goto, 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 this project into a .ez file
mix archive.install   # Install an archive locally
mix archive.uninstall # Uninstall archives
mix clean             # Delete generated application files
mix cmd               # Executes the given command
mix compile           # Compile source files
mix deps              # List dependencies and their status
mix deps.clean        # Remove the given dependencies' files
mix deps.compile      # Compile dependencies
mix deps.get          # Get all out of date dependencies
mix deps.unlock       # Unlock the given dependencies
mix deps.update       # Update the given dependencies
mix do                # Executes the tasks separated by comma
mix     # Builds an escript for the project
mix help              # Print help information for tasks
mix hex               # Print hex help information
mix hex.config        # Read or update hex config
mix          # Publish docs for package
mix          # Print hex information
mix hex.key           # Hex API key tasks
mix hex.outdated      # Shows outdated hex deps for the current project
mix hex.owner         # Hex package ownership tasks
mix hex.publish       # Publish a new package version
mix        # Search for package names
mix hex.user          # Hex user tasks
mix loadconfig        # Loads and persists the given configuration
mix local             # List local tasks
mix local.hex         # Install hex locally
mix local.rebar       # Install rebar locally
mix new               # Create a new Elixir project
mix       # Create a new Phoenix v0.17.0 application
mix run               # Run the given file or expression
mix test              # Run a project's tests
iex -S mix            # Start IEx and run the default task

Then you see a list of tasks that we can play with, next post

Friday, June 12, 2015

Using "wget" to check web server status

Please use this

# wget -O - | grep

-O : indicate output filename
- : send content to std output