Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Thursday, May 19, 2016

Add local registry mirror to docker daemon on systemd ubuntu (after 15.04)

After docker installation, follow this steps

  • Create directory /etc/systemd/system/docker.service.d if not exist
  • Create mirror.conf file inside that directory. The name "mirror" can be changed to anything.
  • In the file, add this lines
[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// --registry-mirror=http://registry-host:registry-port
  • registry-host is hostname/ip of your local registry mirror
  • registry-port is port of your local registry mirror
  • Flush the change with $ sudo systemctl daemon-reload
  • Restart docker with $ sudo systemctl restart docker
  • Check if the change is successfully applied with $ systemctl status docker,  your config should appear somewhere in the command output.
Tested on Docker 1.11, Ubuntu 15.10 & 16.04

If you want more explanations about these commands, please refer to follow links. Thank you for all of them for providing me a direction to solve the issue and also come up with this post.

Wednesday, November 4, 2015

Setup Debian/Ubuntu apt package cache server with Ansible

Install elnappoo.apt-cacher-ng with Ansible Galaxy and then follow the instruction in the README tab or README in the github repository. Refer to the test.yml file as an example. If you cache server doesn't have ufw running, don't forget to set apt_cacher_ng_setup_ufw: False

Tuesday, May 7, 2013

[Ubuntu] Remove Password Prompt For sudo

  • Open a terminal
  • Run sudo visudo
  • Add line 
    • <username> ALL=NOPASSWD: ALL
    • For example, david ALL=NOPASSWD: ALL
  • Save and quit
  • Done
From: https://help.ubuntu.com/community/RootSudo#Remove_Password_Prompt_For_sudo

Friday, August 12, 2011

[Solved] autoscan: not found

If you are in process of compiling something on Ubuntu and you get error similar to these
./bootstrap.sh: 24: autoscan: not found

You have to install autoscan program but you can not find autoscan with
sudo aptitude search autoscan

The package name you have to install is autoconf. I don't know why because I'm not an expert on C/Linux but after below command, the compilation works.
sudo apt-get install autoconf

Monday, August 1, 2011

Create simple Ubuntu(Debian?) start up script

- Create a file at /etc/init.d/<filename>
#!/bin/bash

case "${1:-''}" in
'start')
# put the command to start
;;
'stop')
# stop command here
;;
'restart')
# restart command here
;;
*)
echo "Usage: $SELF start|stop|restart"
exit 1
;;
esac


sudo update-rc.d <filename> defaults


sudo /etc/init.d/<filename> <start|stop|restart>


- To remove
sudo rm /etc/rc*/*<filename>


Credit: Ivan in How do I make sphinx restart when I reboot my Ubuntu server?

Monday, July 11, 2011

[Solved] Ubuntu can not use webcam for video call, while Cheese is working properly

This post is not for people who is facing Linux webcam driver issue, it is for people who can get webcam working (with some application, such as Cheese) but webcam is not working for video calling like Skype or Google video call.

I also don't know the cause but for solution is to set this to environment variable before running video call application
LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so


For convenient, you can rename the original application bin file to other name and making below script naming as bin file.

For example, I did rename my /usr/bin/google-chrome to /usr/bin/google-chrome.real and create a script at /usr/bin/google-chrome with below content
#!/bin/sh
LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so /usr/bin/google-chrome.real


Now Gmail video call on my Google Chrome should work. (Skype also can do the same way)

Tested with Ubuntu 10.04 on 32-bits machine.
Credited to some forums in internet. Sorry for forgotten.

Sunday, October 31, 2010

Ubuntu RAR package file name character encoding problem

In my Ubuntu (currently version 10.10), package named "rar" has encoding problem with file that has file name in Thai. But for package named "unrar" there is no problem.

Saturday, November 28, 2009

How to connect VPN via PPTP with Ubuntu

I had tried to connect to my office local network with my Karmic machine via PPTP protocol. I saw a VPN stuff when clicked 'Edit Connections' of NetworkManager Applet (normally on top left of you screen) but couldn't do anything to it. So I started googling and found below.

First, I had to install PPTP for NetworkManager
sudo apt-get install network-manager-pptp
Now, we can do setting PPTP VPN.

Just enter gateway, username and password your PPTP VPN will be now ready to work.

But for me, I want to go out to normal internet with my internet router not to go through my office network. I have to do something a bit.

In editing vpn, click on tab IPv4 setting -> Routes.

Enter ip(s) that want to use vpn and netmark.

You can leave another 2 columns, gateway and metric blank.

Thick in box "Use this connection only for resources on its network"

done.


Credit : VPN - Ubuntu Wiki, Howto configure PPTP VPN in Ubuntu Intrepid and Jaunty
Testing OS : Ubuntu 9.10 (Karmic Koala)

Sunday, May 31, 2009

Advance Ubuntu keybindings setting

You can go to System -> Preferences -> Keyboard Shortcuts for normal shortkey setting but it isn't enough for me because it isn't work with "Windows" key.

I want Windows+d to bind to "show desktop" as used in Windows but Keyboard Shortcuts doesn't work in this case.

And I found from here How come pressing Super+D doesn't show my desktop?

There's deeper setting.

Run gconf-editor (at command line)

and went to apps -> metacity -> global_keybindings and change "show_desktop" from "d" to "d" (Mod4 is represent Windows key)

And I have also binded "run_command_terminal" to "t"

Configurations after installation my Jaunty Jackalope

After clean installation new Ubuntu - Ubuntu 9.04 or Jaunty Jackalope, I have made many configurations and installing softwares.
Font size
For softwares installations, I chose from Add/Remove so nothing to remember just tick and click but I might forget what and how to make some configurations next installtion time so below is my jot down about these.

That's all for now. I will add it if more configurations are added

Ubuntu : Automount NTFS Drive

For my Ubuntu (9.04), automount ntfs drive don't come out-of-box. It might have been happening for many versions but I didn't notice.

This automount have made some problem to me. For instance, my Rhythmbox Library. Because my musics file was keeping in ntfs drive, so everytime the system was boot the library was error because the drive hadn't mounted. So I want automount very much.

I think I might have fixed it for my 8.04. For 8.10, I used synaptic upgrade from 8.04 so it might still have the configuration from 8.04.

The issue was happended again when I have a clean installation with Jaunty Jackalope.

After some googling, there are many ways to fix this issue but it's too many things to do than I think it should be. Such as fix fstab blah blah. With a great community, there must be easy way to do this.

And now I have found it. Easy one

credit from Joeb454 : HowTo: Automount NTFS Drives

You can follow this link to tg/showthread.php?t=785263he solution or see the summarization for myself below.
  • Install ntfs-config (via apt-get)
  • Unmount wanted drive (if it had mounted)
  • Open it (somewhere in menus or run with command line)
  • Choose drive(s)
  • Enable Write Support for Internal Drives
That's all! After you boot up your system again, you drive will be automounted.

Thursday, March 19, 2009

Add more Listenning port to Apache Http Server for Ubuntu

I have to tell you that this is my method. I'm not sure is there any better workaround to handle this. I'm on Ubuntu Intrepid Ibex.

First, I add this 2 lines to /etc/apache2/ports.conf (I'm gonna add listenning port at port 8000)

NameVirtualHost *:8000
Listen 8000

Second, Edit file named /etc/apache2/site-enabled/000-default by following step

copy content of all in and paste text next to the old one and change *:80 of the new one to *:8000

So you have something similar to this ......

Last, restart your apache with this command "/etc/init.d/apache2 restart"

Booom! Your Apache Http Server will now can listen to 8000 port.

Failed memo :
1. can't restart apache with this command apache2 -k restart
2. If adding just Listen 8000 in /etc/apache2/ports.conf, the 8000 port query is listenned but no thing is displayed.

Wednesday, March 18, 2009

Ubuntu video screen capture

This blog is my memo.

I have use recordMyDesktop for do a video screen capture. Its functions is ok for me. I was install it via Synaptic Package Manager.

Shared folders for Windows 7 Beta guest in Virtualbox 2.1.4

I found the trick here. I have tried it and it's work for me. My machine is Ubuntu Intrepid Ibex which running Virtualbox 2.1.4

- open Regedit (as administrator)
- navigate to this key and change the value to 0 (zero): HKLM\SYSTEM\CurrentControlSet001\Services\VBoxGuest\Start
- reboot the Windows 7 guest
- create a shared folder
- Navigate to (or map to a letter) \\vboxsvr\SHARENAME

Monday, March 16, 2009

[Solved] Can't connect with wired DHCP enabled ADSL router in Ubuntu Intrepid (8.10)

I got a problem that my Intrepid can't connect with wired DHCP enabled ADSL router, which it works fine with other machines running Windows XP

After googling awhile, I found this thread Can't connect to internet via ADSL with 8.10. And my problem was solved with the method in it.

I will summarize it here once :

1. Remove the words "interface-mtu" out of /etc/dhcp3/dhclient.conf

2. Edit /etc/NetworkManager/nm-system-settings.conf and changed managed=false to managed=true.

3. Reboot

done.

hope it's also work with your machine.

Saturday, February 14, 2009

OGV to AVI with mencoder

I have a problem with importing video file that extension is ogv to Openoffice Impress so I decided to convert it to avi. After googling a while I got following commands (I just copy & paste it, will examine it later)

mencoder input.ogm -ovc xvid -oac mp3lame -xvidencopts pass=1 -o output.avi

and

mencoder -idx input.ogv -ovc lavc -oac mp3lame -o out.avi

Friday, January 23, 2009

How to convert unreadable mp3 tag in Ubuntu?

In Asian language (for me, Thai) always suffer unreadable mp3 tag. Here is a workaround to solve it.

install python-mutagen with this command

sudo apt-get install python-mutagen

cd to directory that your files at

and use it with this command

find . -iname "*.mp3" -execdir mid3iconv -e [encode] {} \;

done.

you can choose encode that suit to your language here. For Thai user use ISO-8859-11

credit : ConvertingMP3Tags


Monday, January 19, 2009

Copy non-formatted(plain) text in Ubuntu

Sometime, when we are browsing in the rich text place such as web page and we want to copy some text to our writing field (also rich text field too) without text format but normally it can not do.

In Ubuntu, there is a tool to help you called "Glipper"

you can install it with this command

sudo apt-get install glipper

and then you can add it to your panel. Its name is "Clipboard manager" in Add to Panel menu.

Ubuntu CPU temperature monitor

To monitor temperature of CPU, I'm using panel's item called "Computer Temperature Monitor"

To get it use this command

sudo apt-get install computertemp

then you have to add it to you panel by right-click at a panel, select Add to Panel. Then search with word "temp". There, that's your item to add

Collectd PostgreSQL Plugin

I couldn't find this link when searching with google https://www.collectd.org/documentation/manpages/collectd.conf.html#plugin-postgresq...