Home Blog Page 2093

Wake Up Linux With an RTC Alarm Clock

Most Linux users know how to set scheduled automatic shutdowns using cron. Did you know you can also set automatic wakeups? Most motherboards built after 2000 support real-time clock (RTC) wakeups, so you can have your computer turn itself on and off on a schedule.

BIOS Wakeup

One way to wake up your computer at a scheduled time is to enter your computer’s BIOS and set a wakeup alarm in the Power Management settings. This will be managed either by APM or ACPI settings, depending on the age of your BIOS and any modifications made by the motherboard manufacturer. APM, Advanced Power Management, is an older power management standard. ACPI, Advanced Configuration and Power Interface, is the newer, more advanced standard. Chances are you’ll see both. Look for a setting to set the date and time for wakeups. If this does what you need, you’re done and can go read something else now. On my main workstation it’s limited and only schedules one wakeup event per day, and it won’t let me schedule weekdays only. So this is a job for Linux itself.

 

time, time on linux, rtc alarm clock, scheduled Linux wakeupsJoseph Chamberlain Memorial Clock Tower, tallest clock tower in England. Image courtesy Wikimedia Commons

 

Kernel Support

If you have any scheduled wakeups set in your BIOS, remove them, and then verify your system has all the necessary pieces in place. This how-to is for kernel versions 2.6.22 and later; run uname -r to see your kernel version. Your Linux kernel should already have everything you need, unless you or your distribution maintainer have removed RTC support. So check your kernel configuration file, like this example:

$ grep -i rtc /boot/config-3.2.0-23-generic 
CONFIG_HPET_EMULATE_RTC=y
CONFIG_PM_TRACE_RTC=y
CONFIG_RTC_LIB=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
[...]

That returns a couple dozen lines of output showing full RTC support. Another way is to check your system log. The syslog is configured a little differently on various distros, so one of these two examples should work:

# grep -i rtc /var/log/messages 
$ grep -i rtc /var/log/kern.log

And then you should see several lines of useful output like this:

 Nov 24 07:17:27 studio kernel: [0.248407] RTC time: 15:17:15, date: 11/24/12
Nov 24 07:17:27 studio kernel: [1.692667] rtc_cmos 00:03: RTC can wake from S4
Nov 24 07:17:27 studio kernel: [1.692762] rtc_cmos 00:03: rtc core: registered rtc_cmos as rtc0
Nov 24 07:17:27 studio kernel: [1.692789] rtc0: alarms up to one month, y3k, 114 bytes nvram, hpet irqs
Nov 24 07:17:27 studio kernel: [1.713143] rtc_cmos 00:03: setting system clock to 2012-11-24 15:17:17 UTC (1353943037)

This example shows that the RTC is set to Coordinated Universal Time (UTC), which is desirable because then you don’t have to hassle with daylight savings time. (I love how we can change time itself, instead of adjusting our schedules.) rtc0 is the clock’s device name, which is standard because it would be unusual to have more than one RTC.

Simple Wakeup Test

Now let’s get to the fun part and do a simple manual wakeup test. First check if any wakeups are set:

$ cat /sys/class/rtc/rtc0/wakealarm

No value returned means no alarms are set. These two commands reset the alarm to zero, and then set a wakeup alarm three minutes in the future:

$ sudo sh -c "echo 0 > /sys/class/rtc/rtc0/wakealarm" 
$ sudo sh -c "echo `date '+%s' -d '+ 3 minutes'` > /sys/class/rtc/rtc0/wakealarm"

Now when you run cat /sys/class/rtc/rtc0/wakealarm you should see a value similar to 1354037019. This is the Unix epoch time, which is the number of seconds since UTC midnight 1 January 1970. You need to see a value here to verify that a wakeup time has been set. Next, shutdown your computer and wait for it to start. If this simple test succeeds you are ready to use this simple shutwake script to shutdown and start up your computer whenever you want:

#!/bin/bash 
sh -c "echo 0 > /sys/class/rtc/rtc0/wakealarm"
sh -c "echo `date '+%s' -d '+ 420 minutes'` > /sys/class/rtc/rtc0/wakealarm"
shutdown -h now

It works like this: make it executable, put it in root’s path (like /usr/local/bin), and create a root cron job to run it when you want your computer to shut down, like this example that runs the script at five minutes past midnight on weeknights:

# crontab -e 
# m h dom mon dow command
05 00 * * 1-5 /usr/local/sbin/shutwake

The script will set the wakeup alarm at 420 minutes after shutdown at 12:05AM. This is a lot simpler than hassling with UTC and epoch time conversions, which is what you’ll see in other RTC wakeup howtos. You can easily create multiple shutdown and wakeup times by creating different crontabs and modifying the number of minutes in the wakeup alarm.

RTC can be vexing, and there are a number of factors than can gum it up, so please check out the excellent MythTV ACPI Wakeup for troubleshooting various distros, and what to use for older kernels.

Securing your Web server with SSL/TLS

Aurich Lawson

This is the second part of an ongoing guide to building a home Web server. In part one, we stood up a Linux server or virtual machine and installed Nginx, the powerful event-driven open source Web server behind some of the biggest sites on the Internet today (not to mention Ars Technica!). In this section, we’ll continue configuring the server by adding SSL/TLS encryption, enabling it to serve pages via HTTPS.

If you’ve followed the steps we laid out in our initial feature, you’ve got a safe Nginx server all set up and working. It’s serving your static pages without any issue. We don’t yet have a database, PHP, or anything running on it, but we are ready to take the next step: equipping your Web server with SSL/TLS so that you have the option of serving files via HTTPS.

Using HTTPS doesn’t just mean that your traffic is encrypted—encryption is only half of the story and it’s useless without authentication. What good is it to encrypt something between two parties if you can’t be sure of the identity of the person to whom you’re talking? Consequently, being able to serve HTTPS traffic means you must posses a cryptographic certificate attesting to your identity. Acquiring such a certificate requires you prove your identity to one of many Certificate Authorities, or CAs.

Read more at Ars Technica

Linux Foundation Recognizes Fujitsu and Mr. Masahiro Date

Date-san Accepts Award at LinuxCon EuropeThousands of people contribute to Linux every day. As our annual “Who Writes Linux” paper reports, individuals from around the world are writing millions of lines of code every year. Equally important are the hundreds of companies supporting Linux every year, from sponsoring Linux kernel development to collaborating on technical initiatives to supporting The Linux Foundation. 

As we prepare to conclude 2012, it is worth recognizing the contributions to Linux and The Linux Foundation from Fujitsu and Mr. Masahiro Date. The Linux Foundation recently recognized Mr. Date’s retirement and the many important contributions he and Fujitsu have made to Linux and the Linux community during a formal presentation of an award at LinuxCon Europe. The award was presented by Jim Zemlin and recognized the important role Fujitsu and Mr. Date have played in advancing Linux in Northeast Asia and around the globe through the company’s support of The Linux Foundation.

Both Mr. Date and Fujitsu have been long-term supporters of The Linux Foundation. Mr. Date was a founding board member and instrumental participant in the creation of the Foundation.

With Fujitsu’s support, Mr. Date was able to increase Linux kernel contributions from Japanese companies and brought together the key Linux kernel maintainers with Japanese developers at the first ever Linux Japanese Symposium, which today is known as LinuxCon Japan. Specifically, Fujitsu’s work on cgroups/memory and hotplugs are just couple of the examples of where Fujitsu developers have made technical breakthroughs. As a result, these Fujitsu developers today are invited to attend the Linux Kernel Summit.

Mr. Date’s history and achievements with The Linux Foundation and Linux community can’t be underestimated. Fujitsu’s ongoing contributions to advancing Linux will continue to return benefits to the operating system for years to come.

Android 4.2.1 Jelly Bean Binaries Added to AOSP

Android 421 Jelly Bean binaries added to AOSP

Barely a fortnight after the Android 4.2 binaries were added to the Android Open Source Project database, here comes Android 4.2.1. It appears as if the files have been uploaded for the Nexus 10, Nexus 7, Galaxy Nexus (Verizon model included), but the Nexus 4 is being omitted for the time being. In short, this opens the doors for custom ROM makers to dig in and update their own wares with the latest and greatest from Google. And come December, the users of those wares will be hugely appreciative of that extra 0.1. Hit the source links to grab the newness.

Filed under: , ,

Comments

Source:Google Developers, Android Open Source Project

Read more at Engadget Mobile

Amazon Announces 2 New EC2 Instance Types: Cluster High Memory With 240GB RAM And High Storage With 48TB HDD Space

re-invent-amazon

At Amazon’s re: Invent developer conference in Las Vegas today, the company’s chief technology officer Werner Vogels just announced that the company is launching two new large instance types for its EC2 cloud computing service.

The first is meant for application that need to deal with large-scale, in-memory processing. This “Cluster High Memory” instance type will offer a massive 240 GB of RAM and two 120GB SSDs. The second, the “High Storage” instance is, as the name implies, focused on storage and will come with 117 GB of RAM and 24 hard drive for a total of 48 terabytes of  HDD space.

 

Read more at TechCrunch

Microsoft Surface Pro Will Be Out in January… And Costs More Than a MacBook Air

Click here to read Microsoft Surface Pro Will Be Out in January... And Costs More Than a MacBook Air

Microsoft Surface RT didn’t quite live up to Microsoft’s promise of a true next-generation device, but you know what might? Microsoft Surface Pro. The good news: the Intel-powered ultrabookish tablet mash-up will be out in just a couple of months. The bad news? It might cost more than you want to spend. More »

Read more at Gizmodo

GE Wants to Plug In the ‘Industrial Internet’

The conglomerate unwraps a new suite of technologies that it says will fundamentally change the operation of businesses like airlines, railroads, hospitals, manufacturing, and energy companies. [Read more]

Read more at CNET News

The Perfect Desktop – Linux Mint 14 (Nadia)

The Perfect Desktop – Linux Mint 14 (Nadia)

This tutorial shows how you can set up a Linux Mint 14 (Nadia) desktop that is a full-fledged replacement for a Windows desktop, i.e. that has all the software that people need to do the things they do on their Windows desktops. The advantages are clear: you get a secure system without DRM restrictions that works even on old hardware, and the best thing is: all software comes free of charge.

Read more at HowtoForge

Dell, Intel Eye Investment in Sharp, Report Says

The companies could drop as much as $240 million into Sharp in return for either equity or debt. [Read more]

Read more at CNET News

KDE 4.10 To Change Windows Grouping

The KDE project leader Aaron Seigo announe that the upcoming release of KDE will change how window grouping is handled in the task manager.

Read more at Muktware