Reaction to Ubuntu Phone Announcement

My first reaction is a very positive one. I welcome a new perspective to the mobile market. It’s a cool concept to have the same underlying OS on your phone, desktop, and server. The actual product is about a year from being in consumer hands. But the announcement now means that developers can create apps, handset manufacturers can build phones, carriers can make deals to bring them on their networks, etc. It’s good to have this discussion going.

I’m disappointed with all the negativity on reddit surrounding the announcement. Yes, the project’s not done yet. It’s not ready to ship. It might not be successful. It may not get enough compelling apps. Why be negative? It’s a new year, a new product, a new beginning. Let’s voice our support now. If it fails, it fails, and we can move on to another project. But let’s give this an honest effort and aim for success.

Ubuntu Phone, I’ll vocally support your development starting today. I may not be able to contribute apps but I may buy you when you’re released.

iPhone: Turn Off Phone Network and Data But Keep WiFi On

When you are traveling to a place where your carrier would charge exorbitant prices for data, text, or minutes you may want to disable all phone, text, and data on your iPhone. But you also want to keep Wi-Fi working. It’s a really simple, two-step process, all under Settings.

  1. Turn on Airplane Mode. This will turn off phone, data, text, and Wi-Fi.
  2. Turn on Wi-Fi. Your phone, data, and text services will remain disabled. But you can still iMessage when you’re connected to Wi-Fi.

Convert Windows Server 2012 Datacenter Eval to Datacenter

If you were lucky enough to have used Windows Server 2012 Datacenter eval edition you might have a need to convert it to a regular release. It can easily be done using PowerShell.

Step 1 is to figure out what edition you are currently running.

DISM /online /Get-CurrentEdition

Step 2 is to enter the license key for the full edition. You’ll be asked to reboot the server so say yes.

DISM /online /Set-Edition:ServerDatacenter /ProductKey:ABCD-EFGH-IJKL-MNOP-QRST /AcceptEula

That’s all!

Create deb Package in Ubuntu (Very Brief Introduction)

This is a very brief and basic introduction to creating a deb package. It’s more of a log /history of commands I ran (while learning this myself) and their output. Special thanks to How To Create A .DEB Package [Ubuntu / Debian] for serving as the base I used to build this post. Log in to your Ubuntu machine and open a terminal. Then run the following commands.

cg@codeghar:~$ mkdir custom-package

cg@codeghar:~$ cd custom-package/

cg@codeghar:~/custom-package$ pwd

/home/cg/custom-package

cg@codeghar:~/custom-package$ mkdir credner-1.0

cg@codeghar:~/custom-package$ cd ~/source/

cg@codeghar:~/source$ ls

credner-1.0.tar.gz  credner.py

cg@codeghar:~/source$ vim credner.py

#!/usr/bin/env python3
print ("Hello World!")

cg@codeghar:~/source$ cp credner-1.0.tar.gz ~/custom-package/

cg@codeghar:~/source$ cd -

/home/cg/custom-package

cg@codeghar:~/custom-package$ ls

credner-1.0  credner-1.0.tar.gz

cg@codeghar:~/custom-package$ sudo aptitude install build-essential autoconf automake autotools-dev dh-make debhelper devscripts fakeroot xutils lintian pbuilder

Note: All these packages will be installed as required.

cg@codeghar:~/custom-package$ ls

credner-1.0  credner-1.0.tar.gz

cg@codeghar:~/custom-package$ cd credner-1.0/

cg@codeghar:~/custom-package/credner-1.0$ ls

cg@codeghar:~/custom-package/credner-1.0$ dh_make -e credner@example.com -f ../credner-1.0.tar.gz

Type of package: single binary, indep binary, multiple binary, library, kernel module, kernel patch?
 [s/i/m/l/k/n] s

Maintainer name  : codeghar
Email-Address    : credner@example.com
Date             : Wed, 14 Nov 2012 16:02:15 -0800
Package Name     : credner
Version          : 1.0
License          : blank
Type of Package  : Single
Hit  to confirm:
Currently there is no top level Makefile. This may require additional tuning.
Done. Please edit the files in the debian/ subdirectory now. You should also
check that the credner Makefiles install into $DESTDIR and not in / .

cg@codeghar:~/custom-package/credner-1.0$ ls

debian

cg@codeghar:~/custom-package/credner-1.0$ cd debian/

cg@codeghar:~/custom-package/credner-1.0/debian$ ls

changelog          credner.default.ex   emacsen-startup.ex  menu.ex      README.Debian
compat             credner.doc-base.EX  init.d.ex           postinst.ex  README.source
control            docs                 manpage.1.ex        postrm.ex    rules
copyright          emacsen-install.ex   manpage.sgml.ex     preinst.ex   source
credner.cron.d.ex  emacsen-remove.ex    manpage.xml.ex      prerm.ex     watch.ex

cg@codeghar:~/custom-package/credner-1.0/debian$ vim control

Source: credner
Section: unknown
Priority: extra
Maintainer: codeghar 
Build-Depends: debhelper (>= 8.0.0)
Standards-Version: 3.9.2
Homepage: 
#Vcs-Git: git://git.debian.org/collab-maint/credner.git
#Vcs-Browser: http://git.debian.org/?p=collab-maint/credner.git;a=summary

Package: credner
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: First test deb package
 This is my first deb package attempt

cg@codeghar:~/custom-package/credner-1.0/debian$ vim copyright

Format: http://dep.debian.net/deps/dep5
Upstream-Name: credner
Source: 

Files: *
Copyright: 2012 codeghar 
License: GPL-2+
 This package is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.
 .
 This package is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 .
 You should have received a copy of the GNU General Public License
 along with this program. If not, see 
 .
 On Debian systems, the complete text of the GNU General
 Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".

# If you want to use GPL v2 or later for the /debian/* files use
# the following clauses, or change it to suit. Delete these two lines
Files: debian/*
Copyright: 2012 codeghar 
License: GPL-2+
 This package is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.
 .
 This package is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 .
 You should have received a copy of the GNU General Public License
 along with this program. If not, see 
 .
 On Debian systems, the complete text of the GNU General
 Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".

# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.

cg@codeghar:~/custom-package/credner-1.0/debian$ vim changelog

credner (1.0-1) unstable; urgency=low

  * Initial release (Closes: #nnnn)  

 -- codeghar   Wed, 14 Nov 2012 16:02:15 -0800

cg@codeghar:~/custom-package/credner-1.0/debian$ cd ..

cg@codeghar:~/custom-package/credner-1.0$ dpkg-buildpackage -us -uc -rfakeroot

dpkg-buildpackage: export CFLAGS from dpkg-buildflags (origin: vendor): -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security
dpkg-buildpackage: export CPPFLAGS from dpkg-buildflags (origin: vendor): -D_FORTIFY_SOURCE=2
dpkg-buildpackage: export CXXFLAGS from dpkg-buildflags (origin: vendor): -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security
dpkg-buildpackage: export FFLAGS from dpkg-buildflags (origin: vendor): -g -O2
dpkg-buildpackage: export LDFLAGS from dpkg-buildflags (origin: vendor): -Wl,-Bsymbolic-functions -Wl,-z,relro
dpkg-buildpackage: source package credner
dpkg-buildpackage: source version 1.0-1
dpkg-buildpackage: source changed by codeghar 
dpkg-buildpackage: host architecture amd64
 dpkg-source --before-build credner-1.0
 fakeroot debian/rules clean
dh clean
   dh_testdir
   dh_auto_clean
   dh_clean
 dpkg-source -b credner-1.0
dpkg-source: info: using source format `3.0 (quilt)'
dpkg-source: info: building credner using existing ./credner_1.0.orig.tar.gz
dpkg-source: warning: ignoring deletion of file credner.py
dpkg-source: info: building credner in credner_1.0-1.debian.tar.gz
dpkg-source: info: building credner in credner_1.0-1.dsc
 debian/rules build
dh build
   dh_testdir
   dh_auto_configure
   dh_auto_build
   dh_auto_test
 fakeroot debian/rules binary
dh binary
   dh_testroot
   dh_prep
   dh_installdirs
   dh_auto_install
   dh_install
   dh_installdocs
   dh_installchangelogs
   dh_installexamples
   dh_installman
   dh_installcatalogs
   dh_installcron
   dh_installdebconf
   dh_installemacsen
   dh_installifupdown
   dh_installinfo
   dh_installinit
   dh_installmenu
   dh_installmime
   dh_installmodules
   dh_installlogcheck
   dh_installlogrotate
   dh_installpam
   dh_installppp
   dh_installudev
   dh_installwm
   dh_installxfonts
   dh_installgsettings
   dh_bugfiles
   dh_ucf
   dh_lintian
   dh_gconf
   dh_icons
   dh_perl
   dh_usrlocal
   dh_link
   dh_compress
   dh_fixperms
   dh_strip
   dh_makeshlibs
   dh_shlibdeps
   dh_installdeb
   dh_gencontrol
dpkg-gencontrol: warning: Depends field of package credner: unknown substitution variable ${shlibs:Depends}
   dh_md5sums
   dh_builddeb
dpkg-deb: building package `credner' in `../credner_1.0-1_amd64.deb'.
 dpkg-genchanges  >../credner_1.0-1_amd64.changes
dpkg-genchanges: including full source code in upload
 dpkg-source --after-build credner-1.0
dpkg-buildpackage: full upload (original source is included)

cg@codeghar:~/custom-package/credner-1.0$ ls

debian

cg@codeghar:~/custom-package/credner-1.0$ cd ..

cg@codeghar:~/custom-package$ ls

credner-1.0                  credner_1.0-1.debian.tar.gz  credner-1.0.tar.gz
credner_1.0-1_amd64.changes  credner_1.0-1.dsc
credner_1.0-1_amd64.deb      credner_1.0.orig.tar.gz

cg@codeghar:~/custom-package$ sudo dpkg --install credner_1.0-1_amd64.deb

[sudo] password for codeghar:
Selecting previously unselected package credner.
(Reading database ... 84043 files and directories currently installed.)
Unpacking credner (from credner_1.0-1_amd64.deb) ...
Setting up credner (1.0-1) ...

cg@codeghar:~/custom-package$ dpkg --list credner

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name              Version           Description
+++-=================-=================-==================================================
ii  credner           1.0-1             First test deb package

cg@codeghar:~/custom-package$ dpkg --listfiles credner

/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/credner
/usr/share/doc/credner/copyright
/usr/share/doc/credner/changelog.Debian.gz
/usr/share/doc/credner/README.Debian

cg@codeghar:~/custom-package$ sudo dpkg --purge credner

(Reading database ... 84047 files and directories currently installed.)
Removing credner ...

cg@codeghar:~/custom-package$ dpkg --list credner

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name              Version           Description
+++-=================-=================-==================================================
un  credner                       (no description available)

From this tutorial you can learn the very basics of how to create a deb package. In our example package credner.py was not installed, and that’s alright. Our main purpose was to show the building blocks for now. We also installed a whole bunch of packages we might not have needed for this example. That’s ok, too, because as we continue our learning process we might need them.

My next goal is to create a deb package from a proper Python script. Stay tuned.

Appreciate CentOS Day

I’d like to take an opportunity to declare today the Celebrate CentOS Day. This project provides not only a free-of-cost RHEL alternative but makes it very easy to get up and running. I am specifically thankful for the minimal installer, taking out the guesswork involved in building a minimal server. To provide support for the lifetime of the upstream project is a major task and is appreciated as well. Keep up the good work, CentOS team!

NTP Server

So you want to setup your own NTP server? Setting one up in Ubuntu 12.04 is really easy.

sudo aptitude install ntp

Once it has been installed you can modify its configuration file /etc/ntp.conf. The default settings are pretty sane and you may want to only change the NTP servers it uses. Then start the service if it’s not already started.

sudo service ntp start

But be aware of some issues.

The first one is “stratum”. NTP servers work in a hierarchy and stratum indicates the level in which your server lies. Mostly any stratum 4 or higher is ignored and anything 3 or lower is used. To find out the stratum of your server run the following command.

ntptrace

If you have a high stratum, especially stratum 16, you need to do two things:

1. Use NTP servers with lower stratum as your source in /etc/ntp.conf file. These are servers closest to your geographical location.
2. After starting NTP service wait for about 15 minutes and then run ntptrace again to see if the server’s time has stabilized.

Performing these two actions will go a long way in ensuring that you don’t get the “no server suitable for synchronization” error when using your new NTP server.

Another useful command is:

ntpq -p

I also recently found out that ntpdate is deprecated and has been replaced with sntp.

Hat tip to ntptrace returns stratum 16, ntpq -p shows sync with stratum 2 server for clearing up lots of stuff. Other honorable mentions: NTP Troubleshooting; Network Time Protocol (NTP) Server and Clients Setup in Ubuntu

Fedora: The Good, The Bad, and The Ugly

Kind of like how I did a similar post for Ubuntu I thought it might be a good idea to do one for Fedora. I like and use Ubuntu but some recent decisions by Canonical make me reconsider that loyalty. For now it’s intact though it doesn’t hurt to look at alternatives. Since I have been focusing on Fedora this year this post is relevant for others in the same situation as me.

The Good

  • Presto is the best thing in Fedora (to me at least)
  • Regular releases every six months
  • I’ll add systemd to this list because it’s not too different from using chkconfig and service and works the way it should
  • Cutting-edge technology without having to resort to rolling releases (I prefer distinct releases)
  • Unlike Canonical with Ubuntu, Red Hat doesn’t appear to have too much overt influence on the project’s direction
  • Large repository of packages, comparable to Debian and Ubuntu for packages I’m interested in
  • Better security with SELinux
  • They provide a feature list for the upcoming release as well as completion status
  • I love the Fedora logo
  • Although development is not complete, FirewallD looks like a great idea, and is already available in Fedora 17 to some extent

The Bad

  • Hardware support out of the box is not as good as Ubuntu, mostly because of Fedora’s continued adherence to FOSS ideals. Drivers for important devices, such as wireless, require third-party repositories.
  • Moving from “desktop” to “server” in Fedora has trade offs. Either upgrade at least every year (and get the huge repository of applications) or move to RHEL/CentOS (and sacrifice in respect to the smaller repository of applications plus older software).
  • One year support, although good to stay on the cutting-edge, makes it hard to upgrade that soon. Might not be an issue with me but I can’t really recommend it to my family and friends.
  • If you want to do a fresh install three months after last GA release you have to decide if the last GA is a better bet (end of support in about 10 months, forcing a re-install) or the latest alpha or beta release (end of support in about 16 months but software stability unknown). Compare this with Ubuntu where a fresh install three months after latest final release still gives you 15 months of support and you don’t have to sacrifice stability for support.
  • It has some weird package name choices. For example, Django is called Django.noarch and other Django-related packages are called something like python-django-…noarch or similar.
  • It doesn’t have Unity desktop environment, which I think is the best for my use case
  • Multimedia support is dependent on third-party repositories
  • Some cheaper VPS providers have older versions available and it’s difficult to get a Fedora server, especially with restrictive Anaconda requirements (although they were removed before release of Fedora 17)
  • I really want to learn and like SELinux but it’s too complicated for a beginner. That’s why I have included it in this list.
  • It doesn’t have a functionality like zypper ps by default. One has to install it su -c 'yum install yum-plugin-ps'. Thanks to Equivalent of openSuse “zypper ps” on other distros? for this tip.
  • Any community documentation (blogs, wiki, etc.) can quickly get outdated between releases and it’s a mighty effort for the community to keep its documentation updated.

The Ugly

  • Haven’t seen anything ugly in Fedora
Follow

Get every new post delivered to your Inbox.

Join 26 other followers