LinuxPlanet

Syndicate content
By Linux Geeks, For Linux Geeks.
Updated: 19 hours 9 min ago

Ubuntu 13.04: GNOME vs Unity User Interface Update

Tue, 2013-04-23 23:40
Even as Canonical forges ahead to make Unity the basis of Ubuntu for PCs, phones, tablets and TVs, Linux backer is once again officially supporting GNOME. Ubuntu 13.04, which debuts next week, will have an official GNOME version. That news slipped under the radar for most folks, but it should please some Linux desktop users [...]
Categories: FLOSS Project Planets

Commands to find the CPU temprature.

Tue, 2013-04-23 23:34
As CPUs operate they always generate heat but for every cpu the temprature at which it operates is very important, and all cpus have an upper limit beyond which they should not be allowed to heat.

Here are various ways in which we can find the temprature of the CPU core at any given time.

1.

$ sensors acpitz-virtual-0 Adapter: Virtual device temp1: +43.0°C (crit = +90.0°C) k8temp-pci-00c3 Adapter: PCI adapter Core0 Temp: +34.0°C

The first set of the readings is the core temprature used by the ACPI. The second is of a PCI adapter.

In the first set of reading we can see that the critical temprature is mentioned as 90.0°C, operating the CPU beyond that tempratiure would harm the CPU and mACPI would always shut the system down as soon as the critical temprature is reached.
2.

$ acpi -V Battery 0: Full, 100% Battery 0: design capacity 4400 mAh, last full capacity 3722 mAh = 84% Adapter 0: on-line Thermal 0: ok, 44.0 degrees C Thermal 0: trip point 0 switches to mode critical at temperature 90.0 degrees C Thermal 0: trip point 1 switches to mode passive at temperature 88.0 degrees C Cooling 0: Processor 0 of 3

Norte the "V" is in upper case The fourh line gives the temprature of the core and the fifth line the critical temprature.

The above command will work only if you have ACPI enabled in the system.

3.

$ cat /proc/acpi/thermal_zone/THRM/temperature temperature: 45 C

The above proc file system will exist only if ACPI is enabled. Other than temprature we can find the critical temprature using

$ cat /proc/acpi/thermal_zone/THRM/trip_points critical (S5): 90 C passive: 88 C: tc1=2 tc2=5 tsp=50 devices=CPU0

passive trip point is one at which the hardware is cooled by lowering the cpu freuency etc. Not all hardware support this.
Categories: FLOSS Project Planets

Dell XPS 13 Ubuntu Edition – first impressions

Tue, 2013-04-23 02:53

We received our first Dell XPS 13 Ubuntu Edition laptop last week. We decided to publish a quick review on it, as it is a very impressive product and in general every pre-installed Linux laptop is newsworthy as they are so rare, at least here in Finland. This Dell XPS 13 Ubuntu Edition was released [...]

The post Dell XPS 13 Ubuntu Edition – first impressions appeared first on Seravo.

Categories: FLOSS Project Planets

Jolicloud review – Jolidrive, use it in Chrome/Chromium

Mon, 2013-04-22 07:12
Why Jolidrive? ■ Access all your online data with one simple interface right from your browser. ■ One tab does it all. Enjoy all your online content, regardless of where it’s stored. In one beautiful interface. ■ No need to download files anymore, just run everything from the cloud: - Listen to your music (SoundCloud but also from Box, Dropbox…) - Browse your photos (Flickr, Instagram, Picasa…) - Edit your documents (Google Drive, SkyDrive…) - Watch your videos (Vimeo, YouTube…) - Explore your social content (Facebook, Google+, Tumblr…) - Read your saved articles (Instapaper, Pocket, Readability…) ■ Build a cloud in your image. Combine multiple free storage services and decide which should host your most precious content. With Jolidrive, you’re going to love the cloud.

 

Start with going to: http://www.jolicloud.com/

 

It will automatically ask you to install the chrome/chromium extension. Just do it and start it from a  new tab, where you usually see chrome web store icon.

Start it, and create an account. It will look like this:

 

Start to enable your services and link them to Jolicloud. Facebook, Google+ and alot more are available too.

 

Off course you can play yotube videos directly inside Jolicloud and see dropbox pictures directly inside jolidrive.

This is a good way to have many services in one place. Makes everything a little easier.

I recommend this service, as you can easily browse box, dropbox and google drive in one place. Maybe you don’t use all of those services, but there is other services you can enable for your needs. This jolicloud review is more like showing what it is and what can do.

The post Jolicloud review – Jolidrive, use it in Chrome/Chromium appeared first on Foresight Linux.

Categories: FLOSS Project Planets

HTTP Strict Transport Security for Apache, NGINX and Lighttpd

Sun, 2013-04-21 19:00
HTTP Strict Transport Security (often abbreviated as HSTS) is a security feature that lets a web site tell browsers that it should only be communicated with using HTTPS, instead of using HTTP. This tutorial will show you how to set up HSTS in Apache2, NGINX and Lighttpd.
Categories: FLOSS Project Planets

Google reader alternatives

Sun, 2013-04-21 17:48
Google reader alternatives

 

Everyone knows about this:

We have just announced on the Official Google Blog that we will soon retire Google Reader (the actual date is July 1, 2013). We know Reader has a devoted following who will be very sad to see it go. We’re sad too.

 

Wrote earlier about Google reader alternatives for servers, where you use a own server for the rss feeds. Now it’s time to look at services on the internet.

 

Been testing alot of different rss feed readers, most of them lacks some features i’m looking for.

Like NewsBlur, Netvibes, Feedly, Pulse, The Old Reader, Skimr, Rolio, Smashingreader and BazQux.

 

 

Newsblur

Due to overwhelming demand, free accounts are temporarily suspended.
By going premium you get full access to NewsBlur.

This means you have to pay right away to use it. But ignore it and you still get the free account. It doesn’t have any plugin for chrome/Chromium. Only app available and that only starts the web service.

 

 

Netvibes

Has mobile app for android and iphone, but missing a good chrome extension for the service. There is an old one from 17 december 2009. But seems only be able to add new feeds to Netvibes, nothing else. That seems useless for me though. If you don’t care about chrome extension, then this is a good service to use as rss feeds. Got a similar plugin for Firefox too. Very easy to navigate on the site.

 

 

Feedly

Has android and iphone app for free. Has a working chrome extension, but not perfectly made. Not yet. As you click on the icon, you go directly to the feedly page, but shows unread feeds as number though.

 

Feedly android

The only feeds worth looking at, is Feedly, Newsblur, Netvibes and The old reader. And if you are looking for an android app + chrome extension, then feedly is the one to pick for now. That’s the only one that prvides everything for the moment.

Many users has come to the same conclusion that Feedly is the best one for the moment.

The post Google reader alternatives appeared first on Foresight Linux.

Categories: FLOSS Project Planets

[one-liner]: Why is Conky reporting a lower CPU frequency, when my CPU frequency is actually much higher?

Sun, 2013-04-21 06:41
Background

If you’ve every dealt with Conky you may have gotten a little confused when you’re trying to get it to display your CPU frequency like so:

1 ${freq_g cpu0} Ghz

… and Conky is reporting your CPU frequency as 1.12GHz when in fact it’s actually much higher than that, say 2.67GHz. Most likely this is being caused by the CPU governing features that are present in most modern hardware. Here’s a behind the scenes 5 second tour of seeing what’s going on within your Linux Kernel.

Solution

First, from the conky man page.

cpu (cpuN)

CPU usage in percents. For SMP machines, the CPU number can
be provided as an argument. ${cpu cpu0} is the total usage, and ${cpu
cpuX} (X >= 1) are individual CPUs.

freq_g (n)

Returns CPU #n’s frequency in GHz. CPUs are counted from 1.
If omitted, the parameter defaults to 1.

You most likely have something like SpeedStep enabled which is acting like a governor on a car, regulating the speed of the cores inside your CPU. You can confirm that this is going on by looking at the output of this command:

1 2 3 4 5 6 7 8 9 % less /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 37 model name : Intel(R) Core(TM) i5 CPU M 560 @ 2.67GHz stepping : 5 cpu MHz : 1199.000 ...

The 2 numbers that matter are the 2.67GHz, that the GHz that my CPU is rated to operate at followed by the number 1199.00, this is what my CPU is allowed to run at by the governor setup on my Linux laptop.

You can see what governor is currently configured like so:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 # available governors % sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors powersave ondemand userspace performance # which one am I using? % sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor powersave   # what's my current frequency scaling? % sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq 1199000   # what maximum is available? % sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 2667000   # what's the minimum? % sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 1199000   # what scaling frequencies can my CPU support? % sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies 2667000 2666000 2533000 2399000 2266000 2133000 1999000 1866000 1733000 1599000 1466000 1333000 1199000

You can override your governor by doing the following, using one of the governor’s listed above:

1 % sudo sh -c "echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor" References links

NOTE: For further details regarding my one-liner blog posts, check out my one-liner style guide primer.

Categories: FLOSS Project Planets

[one-liner]: How do you capture the status of a command ($?) in Bash, when run through a pipe?

Sun, 2013-04-21 05:20
Background

While answering questions on the stackexchage website Unix & Linux I saw the following question which was about something I’d encountered, but until today never knew how to accomplish, so I’m posting it here for my own reference in the future.

The question?

How do you get the exit status ( $? ) from the command haconf -makerw in place of grep? i.e. what need to add in to my syntax in order to understand if haconf -makerw succeeded?

1 2 haconf -makerw | grep -iq "Cluster already writable" # echo $? ( will print the exe status from haconf -makerw ) Solution

There are 3 ways of doing this. However your current setup should work. The reason here being that the grep won’t match anything if the command fails, so grep will return with status 1 (unless the program always shows that text no matter what).

Pipefail

The first way is to set the pipefail option. This is the simplest and what it does is basically set the exit status $? to the exit code of the last program to exit non-zero (or zero if all exited successfully).

1 2 3 4 5 # false | true; echo $? 0 # set -o pipefail # false | true; echo $? 1 $PIPESTATUS

Bash also has a variable called $PIPESTATUS which contains the exit status of all the programs in the last command.

1 2 3 4 5 6 7 8 # true | true; echo "${PIPESTATUS[@]}" 0 0 # false | true; echo "${PIPESTATUS[@]}" 1 0 # false | true; echo "${PIPESTATUS[0]}" 1 # true | false; echo "${PIPESTATUS[@]}" 0 1

NOTE: You can use the 3rd command example to get the specific value in the pipeline that you need.

This solution might not be available though. I think $PIPESTATUS might have been added in a fairly recent version of bash, and your OS may not have it.

Separate executions

This is the most unwieldy of the solutions. Run each command separately and capture the status.

1 2 3 # OUTPUT="$(haconf -makerw)" # STATUS_HACONF="$?" # printf '%s' "$OUTPUT" | grep -iq "Cluster already writable" References links

NOTE: For further details regarding my one-liner blog posts, check out my one-liner style guide primer.

Categories: FLOSS Project Planets

About Last Night

Wed, 2013-04-17 13:18

We all grow as time moves right? We make mistakes, or are part of a series of events we're not exactly proud of, yet can't change. The best we can do is either try to make amends if the events were serious enough to warrant that, or learn from them and move on, trying not to exasperate them in the process.

A while ago I appeared on TINAP. It was fun. I enjoyed talking to David, Andy and Luke. In the time since, a series of misunderstandings tumbled together, resulting in myself and the three of them essentially falling out. I have nothing against any of them. I wish them the best in whatever they do. The point is that it got to the point where the most sensible solution for all concerned, was for me to unsubscribe to all three of them, and let them live their lives without any input from me. They seem to have come to the same conclusion.

This is a grown up solution; live and let live.

Actually I should step back a bit, to before TINAP. Many years before that, a good friend told me something I was doing that annoyed him. At first I was annoyed and embarrassed. What he said, he didn't say out of malice; he told me because to him it was clear that I wasn't aware I was doing it. He was right. I've been aware of that trait ever since.

Sometimes it needs someone outside of yourself to point out something you're not even aware you're doing. It's then up to you to either take it onboard or reject it. You can accept it privately while trying to save face if you prefer. I was honest enough not to do that. I did try that approach on Identica with a different user. It backfired.

The experience you get out of any social network is down to who you choose to follow and interact with. If you follow a lot of far riech alarmists, then that's what fills your timeline. If you follow folks who are all of a hive mind on an issue, then that's the experience you get.

I saw a user posting nothing but a negative stream of snarky comments that weren't even savable by being funny or insightful. I saw nothing but negativity coming from that user. I have no idea if he's the same away from his posts or whether he just uses those to blow off steam. I have no idea if he was even aware of just how negative he was coming across. I tried to do to him, what my mate did to me years before. The result was that "it's up to that user what they post or not post, it's up to you to either follow or not". I unsubbed from him, the more people I talk to, the more have also noticed the same traits from the same user and did the same as me.

Some people like causing or inflaming drama. I'm not one of them, despite what some people think. Yes I am strong in my views, and sometimes I lash out, often with sarcasm which doesn't help. When I see the same thing happen with a different user, did I try to point that out to the user? I didn't. I simply unsubscribed from him. Did I choose to make a big drama of "hey, I'm not following you any more bitch"? No. I simply unsubscribed and carried on as usual.

As I said, your experiences on any social network, or even in life as a whole comes down to who you associate with, what you take in and what you give out. I'm a very negative person, perhaps "down" would be more appropriate. I'm aware of that. I'm drawn to dark stories, both real and fictional. I'm drawn to news stories with people who have suffered something. It's like I have an empathy fueled sponge. I use those feelings to spark ideas for stories. Just as I soak in those stories, I also release them back out, in terms of snarky dents or blog posts. I'm aware of that too.

I also have another side which I try to balance with that negative in / negative out loop. I am constantly trying to make people laugh with wordplay jokes, or responses to imaginary typos. Some is just funny to me, while others do get a laugh or a giggle from someone. Even if it gives one person a bit of a smile to alleviate whatever is getting them down at that time, it's a success. I also try to learn new skills whenever I can, albeit in a very hap-hazard piecemeal way. I try to encourage others to do the same. I do screencasts to pass on what little knowledge I have, to others. If someone watches an episode and gets a little bit of confidence that they've learned something new, then it's a success.

The point here is that I'm not only negative enough for a lot of people, but that I'm aware of it, and that I try to mix that up with jokes, learning and encouragement. My choice of websites and who to follow also reflect that. I have no interest in following someone who I percieve to be Mr Grumpy all the time. If I start to see that, I'll unsubscribe from that user. We are in the age where we can pick and choose our diet after all.

After that pre-amble, we get to the point of this post; Satipera. Feel free to click the thumbnails for full page images, from 3 pages of posts, and of the "Van Gogh" comment that triggered this Jeremy Kyle style explosion.

I was for a while subscribed to Satipera, and after a while started to notice the "always negative" stream of dents from him. I chose not to start a drama, so I unsubscribed from him. He did occasionally @reply me, in response to dents I'd posted, links I'd posted, or feedback on something either I or my co-host Kevie said on Crivins. Some of the time I replied, some I didn't. There was no "oh it's him again" thought process, it was purely down to "if the comment triggers something worthy of replying, I will, if not, I won't".

Satipera is one of those who do the "good morning" followed by a lot of nicks. I don't have any issue with that, I'm not interested in joining in with that, regardless of who says it. I never respond to any of those dents, I never start any of those, to me they are a waste of keystrokes. It could also be part of my "I'm a negative / down person" thing, that I just can't imagine doing that. He seemed to take that as a sleight on him personally however. Since I wasn't responding to those dents, apparently I was an "enemy". My counter point is that "do I treat you any different?" I don't respond to ANY of those, he doesn't get left out of some club, I'm not a member of that club and never will be.

I think that if you're not subscribed to a user on Identi.ca, they can't DM you. At least that's what I'm guessing after Satipera lashed out again that he couldn't DM me. I explained this, and invited him to email me with whatever he'd wanted to say. I'm still waiting for that email, although I suspect it will never come. He'd built himself into a position that I was now the "enemy". Apparently it's "rude and childish" to unsubscribe from someone if they still subscribe to you. Who knew? Perhaps I got it confused, perhaps it's rude and childish not to start a drama about "hey, I ain't subscribed you you anymore bitch". I'd chosen the childish path apparently, by simply unsubscribing, no mess, no fuss and carrying on.

When I sensed the email offer wouldn't be taken up, I did resubscribe to him, so he could DM me and get whatever it was off his chest. I got no DMs, despite telling him that's what I intended to do. The result of that evening was him informing me that he was unsubscribing from me, and that I shouldn't talk to him again.

At this point, I'd note that "speak to me" to me, means "start a conversation with". I haven't done that with Satipera for months up till that point as I didn't see any of his dents unless he started a conversation with me, or a dent of his was in the context of another conversation I joined. So the only time I talked to him was as a REPLY to him starting a conversation to me. He was telling me to do what I was already doing. I had no problems keeping doing that. Remember that grown-up "live and let live" thang with the TINAP guys? Apparently Satipera dosn't care for that solution.

At this point he now thinks I'm a cunt, and tells me so. He hates my opinions, whether as part of Crivins, or the articles I link to. The really odd part is that he continues to listen to Crivins. How do I know? I see him comment to Kevie and others. He makes sure to do the whole "talk behind your back" thang by not @ my nick, so I don't see it in my timeline. He's not held himself back from again calling me a cunt in conversations with others.

I'd really hoped for a more inventive use of insults, but hey, it's out of my control.

Now we get to last night. I'm trying to watch a movie but got distracted into a conversation with Satipera that HE started, AGAIN. I see a dent from someone about filtering out Satipera's ear avatar because he's stuck with the same one for as long as I've known him. Maybe it's that vaunted lack of imagination at work, I dunno. An ear kinda implies "I'm listening" but make of that what you will. I chimed in with a joke about it being the ghost of Van Gogh's ear, and that's actually him, an ear. I didn't @reply him but it was in the context of the conversation. An insult? I don't think so, although given how he's interpreted other stuff, who knows what he thinks. This triggered a machine gun of "you're a cunt" @replies from Satipera.

Remember that "don't talk to me" thing he told me? Yeah, it doesn't apply to him apparently. Every single one of those repetitive "you're a cunt" dents was started BY him, talking TO me. Not only is he lacking in imagination, he's also a hypocrite.

During this two or three hour period, I was drinking. I have no idea if his meds had ran out or had been out of date. Either way, with every reply to him, I tried a variety of things, like pointing out his hypocrisy, telling him he must do better with his insults and offering to help him with his "obsession with me" problem. Clearly he gets rather steamed up at my output, but can't help himself from listening to Crivins. I asked him many times if he'd let me help him, by giving me his IP address, so I could block it on the Unseen Studio site. This would help lower his blood pressure, by denying him Crivins when he was at his most weak and determined to download and listen. Like anything resembling real sentences or points last night, he ignored them all, and continued with his "you're a cunt" barrage.

I got a couple of DMs and @replies from other people, basically disgusted by Satipera's behavior. I know he lost subscribers last night. I doubt some will return after his meds kick in, and he attempts to make amends.

Despite all of that, with the barrage of "you're a cunt" insults, I did something in the end that I should not have done. I reminded him that I am an Identi.ca moderator with the power to silence users. A short while after that, triggered by yet another repeat performance of the "you're a cunt" song, I silenced his account. This was wrong. I should not have done that. I woke up to see an @reply from another moderator rightly chastising me. They'd unsilenced his account. If they hadn't, I would have done so myself. The right choice would have been to block him. I apologize for that error in judgement.

Feel free to look at the various conversations from last night, within that few hour timeframe and judge for yourself on both my replies and his. As I said, pay careful attention to the fact that ALL of mine are replies to HIM starting conversations (if you can call some of them that) with me. Juxtapose that with his request that I not talk to him.

I fully expect the "you're a cunt" reply to this post, either in the comments or on Identi.ca. By all means, have your say, but please try to use some imagination; it is a permanent record you know.

Behind all of this, there's a sad story. Unless you're someone super famous who everyone and their dog want to know, your bubble is always gonna be limited. Let me explain; think of your little part of the world that you have an impact on. It's your real life friends, family, partner, exes, workmates, college buddies, online friends from forums, social networks etc. That's your little bubble. It's not that big. Your actions gradually make people want to either enter your bubble, stay in your bubble, or leave your bubble. Most people aren't influenced by the odd outburst, they take a longer view. It's the very human approach of "anyone can have a bad day, or be in a bad mood".

When Satipera went on his rant last night, it didn't affect me in the slightest. It was however played out in public. This meant that some people within his bubble decided to leave it. Every comment you make may just be the straw that breaks the camel's back. a "oh shit, he's off on yet another insult-a-thon, fuck him, enough is enough" moment.

If you do that often enough, eventually your bubble shrinks to include just you. It becomes a place nobody wants to enter. It's also self sustaining in that the more you lash out, the more people who abandon you, the more pissed you get and want to lash out and blame others, which in turn makes even more people leave.

That's a sad, lonely existence. It really is. Nobody wants that.

How do you get out of that spiral of self destruction? You start by noticing it, and the causes of it. Then you make an effort to remove the causes from your day. In Satipera's case, he's taken a strong dislike to me, and everything I say. That's fine, everyone is entitled to their opinion. The issue is that it get's him so worked up as to do what he did last night, yet he still wants to subscribe and listen.

If you order a sandwich only to find it's a shit sandwich what would you do? Eat it anyway? Refuse it and complain? Put a regular order in with the company to bring you daily servings of the shit sandwich just so you can complain to your ever shrinking bubble of people who give a shit, that it is in fact a shit sandwich?

We want feedback on Crivins, on all our shows actually. We welcome it. We welcome it on our blog posts too. I can imagine some folks don't like Crivins because I swear on it. That's fine, it's a perfectly legit reason not to listen to it. Even if you don't have a reason not to listen, that's your prerogative, we respect that. I just find it insane that someone would continue to subscribe to something, and waste their own time and bandwidth in the process, to something they can't stand. Not only that, but something that's pulling them into that self destructive spiral.

I did sarcastically say I'd happily block his IP to help him break out of that funk. As has become pretty common, he ignored that offer.

This is already a kinda long post, sorry about that, I'll finish by apologizing for silencing Satipera. It was wrong, I shouldn't have done that, and by saying "dude, take a long hard look at yourself, and get help before your bubble is down to just you and nobody gives a shit".

Tags: Identica
Categories: FLOSS Project Planets

working of the fuction atomic_add_return

Wed, 2013-04-17 11:33
Atomic instructions are useful for executing instructions with out interrupt. Theory of the same is given in the post. Let us look into the Linux kernel, and see how atomic functions are implemented in the kernel. The atomic variables are declared as type atomic_t which is nothing but a structure defined in "include/Linux/types.h" as given below. Atomic structure :

typedef struct { int counter; } atomic_t;

File: include/Linux/types.h The value of the atomic variable is updated in the counter member of the structure. Atomic functions are written in different ways for different architectures. In this post We will be looking at atomic functions for x86 architecture. One of the atomic functions defined in atomic.h is atomic_add_return. The function is defined as follows.

static inline int atomic_add_return(int i, atomic_t *v) { #ifdef CONFIG_M386 int __i; unsigned long flags; if (unlikely(boot_cpu_data.x86 <= 3)) goto no_xadd; #endif /* Modern 486+ processor */ return i + xadd(&v->counter, i); #ifdef CONFIG_M386 no_xadd: /* Legacy 386 processor */ raw_local_irq_save(flags); __i = atomic_read(v); atomic_set(v, i + __i); raw_local_irq_restore(flags); return i + __i; #endif }

The first line "#ifdef CONFIG_M386" is to check which CPU is the kernel being executed on. This is because in modern x86 CPU there are special instructions available that can be used for atomic operations.

If the architecture is 386, then we check if the instruction xadd is available in the CPU. If xadd is not available then we have to implement the atomic operation manually and we ump to the label no_xadd.

If xadd instruction is available or if the CPU is a modern 486 or above CPU, which always has the xadd instruction, then we make use of the instruction and pass the numbers for addition to xadd. Note that the first argument is the atomic number and the second is the number to be added to the atomic number.

If the system has i486 processor it will be defined in file: include/generated/autoconf.h as #define CONFIG_M686 1

The function xadd is implemented in the file arch/x86/include/asm/cmpxchg.h

/* * xadd() adds "inc" to "*ptr" and atomically returns the previous * value of "*ptr". * * xadd() is locked when multiple CPUs are online * xadd_sync() is always locked * xadd_local() is never locked */ #define __xadd(ptr, inc, lock) __xchg_op((ptr), (inc), xadd, lock) #define xadd(ptr, inc) __xadd((ptr), (inc), LOCK_PREFIX)

From the comment above we note that xadd adds the second argument to the first argument and returns the previous value of the first argument. But note that the value of the first argument is updated to the new value.

xadd has been #defined to __xadd, which in turn has been #defined to __xchg_op. To the function __xcgh_op we pass the two numbers to be added, the instruction "xadd" and the keyword lock to signify that the instruction has to be executed in atomic mode.

The __xchg_op is implemented in the same file as

/* * An exchange-type operation, which takes a value and a pointer, and * returns a the old value. */ #define __xchg_op(ptr, arg, op, lock) ({ __typeof__ (*(ptr)) __ret = (arg); switch (sizeof(*(ptr))) { case __X86_CASE_B: asm volatile (lock #op "b %b0, %1\n" : "+q" (__ret), "+m" (*(ptr)) : : "memory", "cc"); break; case __X86_CASE_W: asm volatile (lock #op "w %w0, %1\n" : "+r" (__ret), "+m" (*(ptr)) : : "memory", "cc"); break; case __X86_CASE_L: asm volatile (lock #op "l %0, %1\n" : "+r" (__ret), "+m" (*(ptr)) : : "memory", "cc"); break; case __X86_CASE_Q: asm volatile (lock #op "q %q0, %1\n" : "+r" (__ret), "+m" (*(ptr)) : : "memory", "cc"); break; default: __ ## op ## _wrong_size(); } __ret; })

The four arguments passed __xcgh_op are

ptr: Pointer to the first argument, for xadd this the atomic variable which needs to be updated. arg: The second argument and for xadd the value to be added to the atomic variable op: The instruction to be executed, in this case "xadd" lock: To signify that the instruction is to be executed atomically.

The four case statements implement the addition for four different sizes of data. Let us take the first case of addition of single byte.

case __X86_CASE_B: asm volatile (lock #op "b %b0, %1\n" : "+q" (__ret), "+m" (*(ptr)) : : "memory", "cc"); break;

The above code implements the instruction using "asm" feature of gcc.

asm volatile: Instructs gcc not to do any optimizations to the code that follows.

lock: keyword to make the instruction execute atomically

op: In this case the "op", the assembly instruction, will be equal to xadd

b %b0, %1: b signifies argument is byte sized and %0,%1 are the arguments to the instruction.

"+q" (__ret), "+m" (*(ptr)): Being the first set of variables after the ":" these are the output variables.

"+" signifies the variable is going to read as well as written

q signifies the value is going to be stored in a register

__ret: Is the first argument to the instructions

m: signifies the value will be stored in memory

*(ptr): Is the second argument to instruction.

There are no input arguments thus there are no arguments in the second set of : : .

The last set of arguments are clobbers which are.

memory: The instruction write to some memory and the values in registers should not be cached by gcc

cc: The instruction affects the condition codes.

The working of xadd in i486 is as below.

XADD dest,sorc Description: Temporary <- dest; dest <- dest + sorc; sorc <- Temporary;

To understand how the asm implementation of xadd is working we can use the followin example code.

#include#include main() { int i=10,j=11; asm("xadd %0, %1\n": "+q" (i), "+m" (j): : "memory", "cc"); printf("i=%d j=%d\n",i,j); }

compile it using gcc and execute it.

$ cc -o xadd xadd.c $ ./xadd i=11 j=21

We can see that the value of i has become equal to "11" which was the value of j and the value of j has become equal to 21 which is the addition of i and j.

Applying the same logic to the kernel code above we can see that the value of __ret will become equal to the value of *ptr, which is the atomic variable, and the value of *ptr will become the sum of *ptr and __ret.

__xchg_op at the end returns __ret which is the value of the *ptr before addition.

Thus in the function atomic_add_return the statement

return i + xadd(&v->counter, i);

Increments the value of atomic variable by "i" and returns, "i" + "value of atomic variable before increment", which is nothing but the new value of the atomic variable.

In case the processor does not have an xadd instruction then the following code gets executed.

#ifdef CONFIG_M386 no_xadd: /* Legacy 386 processor */ raw_local_irq_save(flags); __i = atomic_read(v); atomic_set(v, i + __i); raw_local_irq_restore(flags); return i + __i; #endif

In the absence of support for atomic instructions in the processor, we have to manually disable the interrupts to make the instruction execute atomically. raw_local_irq_save(flags) : Disabling all interrupts
__i = atomic_read(v) : Atomically read the value of the variable and assign it to __i.
atomic_set(v, i + __i): Set the value of atomic variable,v, to sum of __i ,i.
once the value of atomic variable is updated we can enable the interrupts.
raw_local_irq_restore(flags);

Then return the sum of i,__i which is same as the new value of the atomic variable.

This we can see that atomic_add_return is able to perform the addition atomically using either xadd instruction of the processor or by disabling the interrupts manually.


Categories: FLOSS Project Planets

make: Nothing to be done for `default’.

Mon, 2013-04-15 22:12
While writing make files to compile kernel modules we might come across the error

make: Nothing to be done for `default'.

The common cause for the error is lack of tab space before the command.
A make rule always has three parts a target,prerequisite and the command to generate the target from the prerequisite.

target:prerequisite command

For make to be able to differentiate between a command and a target, the command always needs to be prefixed with one tab space. In case we fail to do so then make will not recognize it as a command and throw an error saying that there is no command specified for the target. It is the same error as given above where default is the target.

Thus to solve the problem just open the makefile and add a tabspace before the command for whichever target the error is being thrown.


Categories: FLOSS Project Planets

[one-liner]: Checking out a HDD’s Health using the Command Line Tool udisk

Mon, 2013-04-15 16:50
Background

Here’s a quick tip for checking out the overall health of your computer’s hard drive. It makes use of a little known tool called udisks which provides access to information about storage devices from the D-Bus interface.

Solution

Before we jump into udisks here are some resources that might prove useful when dealing with the design/architecture of udisks.

To see which drives are currently under udisks watchful eye, you can use the following command:

1 2 3 4 5 6 7 8 9 10 11 12 % sudo udisks --enumerate /org/freedesktop/UDisks/devices/dm_2d0 /org/freedesktop/UDisks/devices/dm_2d1 /org/freedesktop/UDisks/devices/dm_2d2 /org/freedesktop/UDisks/devices/sda1 /org/freedesktop/UDisks/devices/sda2 /org/freedesktop/UDisks/devices/sda3 /org/freedesktop/UDisks/devices/sda4 /org/freedesktop/UDisks/devices/sda5 /org/freedesktop/UDisks/devices/sda6 /org/freedesktop/UDisks/devices/sr0 /org/freedesktop/UDisks/devices/sda

This output shows that I have several partitions that are currently bing monitored, the last bit in the path tells you which device, i.e. sda1, sda2, sda3, etc. These are partitions /dev/sda1, /dev/sda2, etc.

Now on to the actual health output. This next command will show you the overall health of device /dev/sda, i.e. my primary HDD on my laptop:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 udisks --show-info /dev/sda Showing information for /org/freedesktop/UDisks/devices/sda native-path: /sys/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda device: 8:0 device-file: /dev/sda presentation: /dev/sda by-id: /dev/disk/by-id/ata-ST9500420AS_5VJ9H3BY by-id: /dev/disk/by-id/scsi-SATA_ST9500420AS_5VJ9H3BY by-id: /dev/disk/by-id/wwn-0x5000c5002ed97512 by-path: /dev/disk/by-path/pci-0000:00:1f.2-scsi-0:0:0:0 detected at: Mon 15 Apr 2013 01:00:39 PM EDT system internal: 1 removable: 0 has media: 1 (detected at Mon 15 Apr 2013 01:00:39 PM EDT) detects change: 0 detection by polling: 0 detection inhibitable: 0 detection inhibited: 0 is read only: 0 is mounted: 0 mount paths: mounted by uid: 0 presentation hide: 0 presentation nopolicy: 0 presentation name: presentation icon: size: 500107862016 block size: 512 job underway: no usage: type: version: uuid: label: partition table: scheme: mbr count: 6 drive: vendor: ATA model: ST9500420AS revision: 0003LV1M serial: 5VJ9H3BY WWN: 5000c5002ed97512 detachable: 0 can spindown: 1 rotational media: Yes, at 7200 RPM write-cache: enabled ejectable: 0 adapter: /org/freedesktop/UDisks/adapters/0000_3a00_3a1f_2e2 ports: /org/freedesktop/UDisks/adapters/0000_3a00_3a1f_2e2/host0 similar devices: media: compat: interface: ata if speed: (unknown) ATA SMART: Updated at Mon 15 Apr 2013 09:26:39 PM EDT overall assessment: Good =============================================================================== Attribute Current|Worst|Threshold Status Value Type Updates =============================================================================== raw-read-error-rate 104| 99| 34 good 6520505 Pre-fail Online spin-up-time 100| 99| 0 n/a 0 Pre-fail Online start-stop-count 98| 98| 20 good 2785 Old-age Online reallocated-sector-count 100|100| 36 good 0 sectors Pre-fail Online seek-error-rate 72| 60| 30 good 25872919731 Pre-fail Online power-on-hours 89| 89| 0 n/a 424.5 days Old-age Online spin-retry-count 100|100| 97 good 0 Pre-fail Online power-cycle-count 98| 98| 20 good 2753 Old-age Online attribute-184 100|100| 99 good 0 Old-age Online reported-uncorrect 100|100| 0 n/a 0 sectors Old-age Online attribute-188 100| 96| 0 n/a 0 Old-age Online high-fly-writes 100|100| 0 n/a 0 Old-age Online airflow-temperature-celsius 58| 42| 45 FAIL_PAST 42C / 108F Old-age Online g-sense-error-rate 100|100| 0 n/a 124 Old-age Online power-off-retract-count 100|100| 0 n/a 15 Old-age Online load-cycle-count 1| 1| 0 n/a 248327 Old-age Online temperature-celsius-2 42| 58| 0 n/a 42C / 108F Old-age Online hardware-ecc-recovered 44| 38| 0 n/a 6520505 Old-age Online reallocated-event-count 89| 89| 30 good 79886391715520 Pre-fail Online current-pending-sector 100|100| 0 n/a 0 sectors Old-age Online offline-uncorrectable 100|100| 0 n/a 0 sectors Old-age Offline udma-crc-error-count 200|200| 0 n/a 0 Old-age Online attribute-254 100|100| 0 n/a 0 Old-age Online

One thing to note, my HDD is essentially overheating at 58 degrees celcius while threshold for that value is suppose to be 45 degrees celcius. Might need to think about replacing it some time soon 8-).

Here’s another way to get just the health information using the –dump switch instead.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 % udisks --dump | grep -A 24 Updates   Attribute Current|Worst|Threshold Status Value Type Updates =============================================================================== raw-read-error-rate 103| 99| 34 good 6214810 Pre-fail Online spin-up-time 100| 99| 0 n/a 0 Pre-fail Online start-stop-count 98| 98| 20 good 2785 Old-age Online reallocated-sector-count 100|100| 36 good 0 sectors Pre-fail Online seek-error-rate 72| 60| 30 good 25872903767 Pre-fail Online power-on-hours 89| 89| 0 n/a 424.4 days Old-age Online spin-retry-count 100|100| 97 good 0 Pre-fail Online power-cycle-count 98| 98| 20 good 2753 Old-age Online attribute-184 100|100| 99 good 0 Old-age Online reported-uncorrect 100|100| 0 n/a 0 sectors Old-age Online attribute-188 100| 96| 0 n/a 0 Old-age Online high-fly-writes 100|100| 0 n/a 0 Old-age Online airflow-temperature-celsius 58| 42| 45 FAIL_PAST 42C / 108F Old-age Online g-sense-error-rate 100|100| 0 n/a 124 Old-age Online power-off-retract-count 100|100| 0 n/a 15 Old-age Online load-cycle-count 1| 1| 0 n/a 248327 Old-age Online temperature-celsius-2 42| 58| 0 n/a 42C / 108F Old-age Online hardware-ecc-recovered 44| 38| 0 n/a 6214810 Old-age Online reallocated-event-count 89| 89| 30 good 181604102186687 Pre-fail Online current-pending-sector 100|100| 0 n/a 0 sectors Old-age Online offline-uncorrectable 100|100| 0 n/a 0 sectors Old-age Offline udma-crc-error-count 200|200| 0 n/a 0 Old-age Online attribute-254 100|100| 0 n/a 0 Old-age Online References links local copies

NOTE: For further details regarding my one-liner blog posts, check out my one-liner style guide primer.

Categories: FLOSS Project Planets

Negotiating With Rebellious Rogues – Part 3

Mon, 2013-04-15 12:55
A continuation from:  http://dtbnguyen.blogspot.com/2013/04/negotiating-with-rebellious-rogues.html http://dtbnguyen.blogspot.com/2013/04/negotiating-with-rebellious-rogues-part.html

Key issues/questions:
- Believe that the current US administration may be too conservative with their approach. As I've previously indicated here, concepts like 'measured response' and 'deterrence' only work if your opponent is sane, believes that you will back down, or that you are utlimately unwilling to escalate further/quickly. Must be willing to 'ratchet up' just as quickly as down...
- Propose a 'measured response' initially but dramatically escalating when/if required (similar to past 'deterrence' policy with regards to nuclear arms during the 'Cold War'). This will ensure that they know if they attack we will respond.
- I've said that we should be more pro-active with regards to handling of 'rogue states' and I'll say it again. We need to be swifter, harder, creative, and more pro-active no matter what actions we may take as they've already hardened their economies against sanctions and other measures we are likely to take. They need to know/understand that for every provocation that they make their will be a reaction, one that is likely to destablise them as much as us. Moreover, OSINT indicates that while the regime may have about 9/10 figures in assets if they are hit hard/quickly enough they will likely collapse.
http://www.foreignpolicy.com/articles/2013/04/15/economics_war_north_korea_kim_jong_un
- I've always believed that diplomacy, intelligence, and defense should work in unison to help reduce the chances of longer term conflict. Number one reason is that it means that if one doesn't work you're not hamstrung in should one one of these fails. Have been thinking about this further in the context in North Korea. If we are more pro-active (and push back) we'll be better able to ascertain just how far we can push. This also means we can begin to formulate a strategy which means that we can make moves which will utlimately force them to make moves. Not enough pressure on them and they'll just stall and/or continue on their merry way. If not enough progress still push but less. Work to a timeline, don't let discussions dangle.
- The reason for the emphasis in speed is that it also gives them less time to adapt. Moreover, it's clear that 'operational security' on the 'Allied side' is often lacking. In fact, fairly recently plans for pre-emptive attacks/responses to North Korean provocations were compromised during a cyberattack (cause was basically down to procedural error). Moreover, the less time something needs to be maintained as a secret the less likely and more effective the plans are going to be.
- Number of different interpretations of answer/s that have been provided in response to calls for possible peace talks. Response indicates that earlier desire for peace was a deception, that they are willing to give up short term stability for longer term gain. May indicate that may be looking for further concessions? a desire to suss out their opponent more? unsure of how to respond? want more time to respond? Also indicates that within their framework they are limited with regards to how to respond. Remember that while the way they deliver their message may have changed ('sliced salami diplomacy' versus 'jackpot diplomacy' was probably the best/enjoyable way of describing Kim Jong Il versus Kim Jong Un) their basic intentions have not. Would like to probe further and see how they respond to actions outside of their normal realm of understanding/framework... (also known as 'Black Box' or 'Fuzz' testing in the Software Engineering world). If want to engage will have to get them to become more succint, concise, push this along...
http://www.theaustralian.com.au/news/breaking-news/kerry-prepared-to-reach-out-to-north-korea/story-fn3dxix6-1226620387426
http://www.bbc.co.uk/news/world-us-canada-22146598
http://www.smh.com.au/world/north-korea-likely-to-have-nuclear-warhead-for-its-missiles-pentagon-20130412-2hphf.html
http://www.independent.co.uk/news/uk/home-news/never-mind-nuclear-war-says-north-korean-defector-jooil-kim-the-reality-of-famine-is-bad-enough-8572552.html
Think that there should be more room with regards to pre/conditions for talks but need to be more focused with regards to ultimate goals though. We've been meandering around this problem for far too long.
http://security.blogs.cnn.com/2013/04/15/on-north-koreas-big-day-kerry-underlines-conditions-for-talks/
http://edition.cnn.com/2013/04/15/world/asia/koreas-tensions/index.html
- Pre-emptive strikes can not be ruled out but should also be taken under advisement. You'd rather an opponent with less complete/inferior weapons than one that has stretched for more time with more advanced capabilities/responses.
http://blogs.wsj.com/korearealtime/2013/04/12/north-korean-missiles-an-inventory/
http://www.thedailybeast.com/articles/2013/04/15/exclusive-u-s-recovered-north-korean-rocket-head.html 
- North Korea and other states handling the issue of self defense badly (from external perspective but probably sures up support internally). Missile launches, nuclear tests, tearing up armistice agreements, declaring a state of war, and other rhetoric (such as threatening to 'wipe neighbours off the map', or bathing them in 'seas of fire') can only described as confrontational in most parts of the world rather than simply, 'standing up for their rights'.
http://www.abc.net.au/news/2013-04-14/n-korea-rejects-seouls-offer-of-talks/4628104
http://nymag.com/daily/intelligencer/2013/04/professor-thinks-we-should-bomb-north-korea-now.html
http://www.thesun.co.uk/sol/homepage/features/4885931/north-korea-defector-on-how-state-brainwashes-people.html
http://edition.cnn.com/2013/04/12/world/asia/north-korea-we-rarely-see/
Need to emphasise that every single move that Allied forces have made has mostly been defensive in nature. Drills in the past have proven to be as much of a problem? they've almost always been the provocateurs in past encounters (attacks on South Korean islands, US servicemen, etc...) Moreover, some of the measures that have been taken can only be described as prudent. Why wouldn't you deploy a missile defense shield battery (a system which is purely defensive in nature if you're aware of how many of them work) if your citizens are risk and you have the ability/resources to do so? Aegis class ships are only there as a support mechanism for the missile defense system, etc...
- 'Allied' nations have clearly made steps to reduce the tension. Believe that it's time for North Korea to return the favour and to return to peace and stability on the Korea peninsula.
http://www.brisbanetimes.com.au/world/kerry-seeks-active-role-for-china-in-easing-n-korea-nuclear-crisis-20130413-2hs86.html
http://news.ninemsn.com.au/world/2013/04/15/04/28/kerry-prepared-to-reach-out-to-north-korea
http://www.usatoday.com/story/news/world/2013/04/14/korea-nuclear-threat-kerry-trip-eternal-leader-anniversary/2081711/
- Looked further at Kim Jong Un. Some reasons for selection are obvious. Younger age, supposedly stronger character, outgoing nature which will help him to work at both the national and international level and so on...
http://www.mirror.co.uk/news/world-news/north-korea-crisis-kims-former-1830810
http://www.washingtonpost.com/world/national-security/north-korean-leader-kim-jong-un-offers-many-faces-many-threats/2013/04/13/c8f0aa70-a3ad-11e2-82bc-511538ae90a4_story.html
http://www.washingtonpost.com/opinions/david-ignatius-kim-jong-uns-dangerous-game/2013/04/11/a618c52a-a2ed-11e2-9c03-6952ff305f35_story.html
http://www.washingtonpost.com/blogs/worldviews/wp/2013/04/09/those-photos-of-young-kim-jong-un-performing-in-grease-are-probably-of-his-brother/
http://www.smh.com.au/world/inside-the-mind-of-kim-jongun-20130415-2hunu.html
What's also clear is that for most of his life he's always had whatever he wants? Curious to see how he reacts to provocations and other moves against him? What I'd also like to know curious about is just exactly how much of the rhetoric is actually his and how much of his messages are 'composites answers'. Hard to know without better HUMINT. Curious to know whether he is someone who can be crafted, molded, convinced (believe that most of his character is fairly set now though. However, if all these moves are actually about stablising his status believe that there may be a chance of influencing him at some point down the line)? At the moment it just seems like he does whatever he wants regardless of the consequences?
http://www.nytimes.com/2013/04/14/world/asia/kim-jong-un-tests-relations-with-china.html?_r=0
- If he's trying to solidify his grip on power then wondering whether or not this is the perfect time/opportunity to destablise his leadership? Likely response will be brutality as in the past... What happens if you can't extract concessions/consolidate power? What if our responses undermine his and ultimately North Korea's position? Is this information actually true or is it just mis-information?
http://www.nypost.com/p/news/opinion/opedcolumnists/how_to_defeat_north_korea_L34Z2ykzkFlMiZsYyewjVM
- Assumption by many 'rogue states' is interesting. All seem to be making the assumption that if they are able to acquire nuclear weapons and other WMD they are able to hold others to ransom once they have acquired them. Doesn't entirely fit in with their idea that their desire for WMD is to reduce the chances/possibilities of invasion. Interesting how the implications of the North Korea standoff will have on other parts of the world.
http://www.americanthinker.com/2013/04/does_an_attack_on_iran_mean_an_attack_on_south_korea.html
http://www.jta.org/news/article/2013/04/09/3123881/in-iran-talks-north-korea-parallel-goes-only-so-far
http://www.washingtonpost.com/blogs/right-turn/wp/2013/04/09/fantasyland-foreign-policy-on-north-korea-and-iran/
http://gulfnews.com/opinions/columnists/lessons-from-the-nuclear-brinkmanship-from-north-korea-to-the-gulf-1.1170379
- Obvious offramp for North Korea at the moment would be to simply end the rhetoric, reform, and work with China/Russia. Allows them to help build a better North Korea without many of the risks associated with working with traditional enemies.
http://www.foxnews.com/us/2013/04/14/us-japan-ready-to-talk-if-north-korea-starts-denuclearizing-north-rejects-south/
http://www.smh.com.au/world/north-korea-likely-to-have-nuclear-warhead-for-its-missiles-pentagon-20130412-2hphf.html
http://www.forbes.com/sites/larrybell/2013/04/14/the-ultimate-north-korean-missile-threat-to-america-a-nuke-power-grid-attack/
http://www.globalresearch.ca/inventing-a-north-korean-threat-attacking-north-korea-or-iran-could-precipitate-a-global-war/5331207
http://www.upi.com/Top_News/US/2013/04/12/Former-CIA-director-recommends-the-US-threaten-Russia-and-China-for-cooperation/8091365780296/#ixzz2QOvbO14k
http://seekingalpha.com/article/1337751-china-s-relationship-with-north-korea-will-affect-us-investments-in-asia
http://www.csmonitor.com/World/Asia-Pacific/2013/0415/North-Korea-s-Kim-Jong-un-celebrates-missile-free-holiday-video
http://gulfnews.com/opinions/columnists/don-t-provoke-north-korea-1.1169966
http://www.guardian.co.uk/global-development/2013/apr/11/barack-obama-budget-us-food-aid
http://www.nytimes.com/2013/04/08/world/asia/us-and-south-korea-devise-plan-to-counter-north.html?pagewanted=all&_r=0
http://online.wsj.com/article/SB10001424127887324030704578424073391422526.html
http://economictimes.indiatimes.com/news/news-by-industry/et-cetera/for-us-and-north-korea-will-crises-ever-end/articleshow/19456183.cms
http://e-ring.foreignpolicy.com/posts/2013/04/09/why_doesn_t_seoul_have_iron_dome
http://www.huffingtonpost.com/rajan-menon/korea-the-proposals-pagea_b_3081424.html
http://www.thestar.com/news/world/2013/04/13/north_korean_restaurant_in_beijing_where_politics_is_on_the_menu.html
http://www.dailymail.co.uk/news/article-2308705/Inside-North-Korea-A-rare-dispatch-deep-lunatic-rogue-state-enslaved-Zombie-Sons.html?ito=feeds-newsxml
http://www.washingtontimes.com/news/2013/mar/26/websites-about-north-korea-defectors-are-knocked-o/
Categories: FLOSS Project Planets

HP ILO – Quickly gather ILO version and firmware information via CURL

Fri, 2013-04-12 19:00
Have a lot of HP servers with ILO cards, and want to gather information from them quicly? By default you can get some information in XML format, for ILO, ILO2, ILO3 and ILO4, with curl.
Categories: FLOSS Project Planets

Announcing Foresight Linux 2.5.3

Fri, 2013-04-12 03:35

Foresight is a Linux distribution for your desktop that features a rolling release schedule that always keeps your desktop up to date; a revolutionary package manager, Conary; the latest GNOME2Lxde and Xfce desktop environment and an innovative set of excellent, up to date software applications.

We have new set of iso for GNOME2Lxde and Xfce.

We hope you enjoy using Foresight as much as we do. Because your distro should be cool!

Foresight is currently dependent on rBuilder to build anaconda images. Because Foresight is a rolling release with regular updates, updating install images was perhaps lower priority, but also, rBuilder quit working for building Foresight images quite some time ago, which really got in the way of posting new images.

 

Note: these images still use an older version of anaconda and an older kernel, so some new hardware is still not supported. Also, ext4 is not supported in these images.  Sorry. New kernel will be installed after installation and running updateall.  For the moment, the version available in stable repository is 3.4.38

The brave ones can follow this guide to get ext4 support from start: http://wiki.foresightlinux.org/wiki/display/docs/Foresight+Linux+ghetto+install+HOWTO

 

Foresight Linux 2.5.3 Release Notes
  1. What’s new
    1. First release of Lxde with conary.
    2. Xfce 4.10
    3. Gnome2 with updated applications
  2. Conary
  3. Downloading and Installing
  4. Filing Issues and Bugs
  5. Getting Help
  6. Contribute to Foresight Linux
  7. More information
  8. Credits
What’s new

Foresight Linux 2.5.3 , released March 31th, features the latest stable packages. This release is for new users as well as for returning users and early adopters! Existing users of our previous release has the latest already from updateall!

GNOME, Lxde and Xfce

Foresight features the latest stable versions of GNOME2Lxde and Xfce!

  • GNOME is a popular, multi-platform desktop environment for your computer. GNOME’s focus is ease of use, stability and first-class internationalisation and accessibility support. Running with latest firefox, pidgin, skype and alot more.  Foresight still uses GNOME2.
  • Lxde The “Lightweight X11 Desktop Environment” is an extremely fast-performing and energy-saving desktop environment,  and a platform to easily build new applications upon. Using applications from GNOME to make it work in all kinds of different ways. Using notify-osd, chromium and thunderbird as default applications.
  • Xfce is a lightweight desktop environment for UNIX-like operating systems. It aims to be fast and low on system resources, while still being visually appealing and user friendly. We have Xfce version 4.10, all Xfce applications are up to date.
Kernel 3.4

Foresight also includes the polished and refined Long Term Support 3.4 Linux kernel. If new and shiny is more your thing, you will be pleased to learn that the newly minted Linux kernel 3.4 is currently undergoing shakedown tests by Foresight’s bravest and is slated to become available as a drop-in upgrade in the coming weeks for the adventurous kind!

Tons of new applications and improvements

Foresight brings to you a vast and cool selection of awesome applications to give you and your desktop that little something extra that will make your friends sit up and take notice! We’re proud to ship the very latest and greatest Chromium and Firefox web browsers, Pragha, Spotify, Wine, playonlinux, Pidgin, Gimp, Dropbox, and many more great applications for your delight!

 

Conary

Conary is a distributed software management system for Linux distributions. Conary tools can be used to package software for desktop distributions such as Foresight Linux, or for building software appliances and derivative distributions based on Conary.

Conary replaces existing software package management solutions with features developed to address some of the common problems in package management. Conary features software installed and maintained from networked repositories.

With dependencies defined at the file level, Conary’s built-in dependency resolution brings in only the components needed from other packages instead of entire packages. Conary users can install and maintain software as well as to roll a Conary-based system back to a previous state before one or more updates.

A new update mechanism called “system model” is added. In this model, a file called /etc/conary/system-model describes what should be installed on the system. This file is modified by certain conary update commands, and can also be edited with a text editor. The system model allows a system to be updated relative to a search path that includes groups as well as labels, leading to more coherent sets of updated packages. It also allows re-starting updates with transient failures; the filename /etc/conary/system-model.next is reserved for storing the system target state during an update operation.

 

Downloading and Installing

Downloads are available at our downloads page, where you’ll be able to choose from our GNOME, Lxde and Xfce images for both 32-bit and 64-bit systems.

Filing Issues and Bugs

Please report any issues or bugs you encounter while using Foresight 2.5.0. Foresight’s issue tracker, JIRA, is available at https://issues.foresightlinux.org.

Getting Help

Help is available in many forms, and you can choose what you’re most comfortable with.

  • IRC: Visit the Foresight IRC channel, #foresight on Freenode, and ask questions. We have one of the most friendly IRC channels you’ll come across with everyone from users to developers reaching out to help answer questions.
  • Forums: Our forums continue to grow, and are a good source of information to check if a specific problem or question has come up before.
  • Wiki: Documentation on the wiki is growing on a daily basis, with updates often to the Frequently Asked Questions and other how-to’s to get you going with Foresight Linux.
  • Mailing Lists:
Contribute to Foresight Linux

Foresight Linux has a vibrant and friendly community, ready to assist any level of user. Participation is also welcome and encouraged! There are several different ways to engage with the Foresight community:

  1. You can find us in #foresight on chat.freenode.net. Foresight users can click the X-Chat GNOME icon in Applications -> Internet menu to access IRC
  2. Contribute to the Foresight Wiki
  3. Package and maintain software. Visit the Developer Wiki at http://wiki.foresightlinux.org/wiki/display/DEV/Foresight+Linux+Development for more information
More Information

You can find more information about Foresight on our website at http://www.foresightlinux.org.

The developer Tomas Forsman has a unofficial www.foresightlinux.se site with wiki.

If you’re new to using Foresight, please check out the Getting Started with Foresight User Guide. Click on System -> User Guide. The User Guide contains information on installing software, adding MP3 and DVD support, and an overview of commonly used applications.

Ask live questions in IRC on the Freenode network in the #foresight channel.

Credits

Thanks to the entire Foresight Linux Project crew all the developers and users who contributed to and helped test this release.

Thank you for using Foresight. Because your distro should be cool!

Categories: FLOSS Project Planets

Munin plugin to show Logstash/Kibana messages per hour

Thu, 2013-04-11 19:00
This is a simple munin plugin which shows you the amount of log messages your logstash/kibana server receives per hour.
Categories: FLOSS Project Planets

How to use ffmpeg x11grab

Thu, 2013-04-11 17:18
Using ffmpeg with x11grab

The ffmpeg is cross-platform and very powerful software to handle video/audio or to stream it. On Linux ffmpeg can capture X11 screen with a command. This method gives the best results for screencaptures and is one of the the most flexible methods, allowing a variety of audio inputs and audiovisual output formats.

 

For the record, here is how ffmpeg works:

ffmpeg [input options] -i [input file] [output options] [output file]

Now it’s time to test it, open terminal and write:

ffmpeg -f alsa -i pulse -f x11grab -r 30 -s 1024x768 -i :0.0 -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -threads 0 output.mkv

Similar command, with less detailed sound and stuff:

ffmpeg -f x11grab -s 1024x768 -r 25 -i :0.0 -sameq output.mkv

 

This will create a output.mkv with great detailed screencast/record of your desktop. As soon you are done recording, push “q” and it will stop in Terminal. Also change 1024×768 to your screen resolution before you run the command.

This is probably the best way to create detailed screencast with great resolution and no loss of details.

Wont dig any deeper about remaking the file to other formats. But will update this post soon to add few ways to remake mkv file to other format, if someone wants that.

A benefit of using Pulse Audio is that several inputs can be combined, allowing both microphone input and music input, for example. The relative volumes can be controlled using Pulse Audio Volume Control. 

 

Problems with delayed audio?

When i use 25 or 30 frames per seconds, my sound starts later and the video goes too fast.

So I removes that from the command line and use this instead:

ffmpeg -f alsa -i pulse -f x11grab -s 1366x768 -i :0.0 output.mkv

 

Other methods to record desktop / screencast

I did write some time ago about 5 ways to record your desktop, and you can read all about it here: 5-ways-to-record-your-desktop-in-linux/

And the conclusion was that ffmpeg x11grab is the best way to record your desktop.

The commands I wrote earlier, you need to change the resolution to match your resolution of your monitor. Just change the numbers that are: 1366×768 to match your resolution.

 

General note

If you have a slow computer, it will not be smart to grab and encode your video at the same time, because slow CPU will not be able to do this. In that case, first grab all you need and save it as uncompressed video/audio and when you finish the grabbing process then start converting it to whatever you need.

 

Categories: FLOSS Project Planets

Negotiating With Rebellious Rogues – Part 2

Thu, 2013-04-11 06:41
A continuation from, http://dtbnguyen.blogspot.com/2013/04/negotiating-with-rebellious-rogues.html

Has been interesting watching some of the messages being sent out and the way they've been interpreted.

Key problems/issues:
- is it that Kim Jong Un doesn't know how to ratchet down (Offer them a set of choices? Make signal too indirect and they may not understand it? Too direct and they may just ratchet it up again.)? or is he being influenced not to go down? Based on what I've read about him this doesn't seem like his 'natural personality' or his wording/phrasing (if feels like they've learnt from or were taught by the Iranians). Need further information though. Likely need a combination of greater background work by intelligence analysts (keep in mind the notion of 'projection' when doing analysis) and analysis by defectors.
http://thecable.foreignpolicy.com/posts/2013/04/09/exclusive_us_and_north_korea_held_secret_meeting_in_march
- this is as much about us as about them. For a long while now, North Korea has used provocations and other techniques as a means of gaining concessions. They've been pushing back members of the international community and we've been responding to threats. Shutting down all communications is simply another means of controlling the situation from there side. Become proactive whether it has to do with offers of peace, aid, war, etc...
http://www.reuters.com/article/2013/04/10/us-korea-north-bank-idUSBRE93900L20130410
http://www.abc.net.au/radionational/programs/latenightlive/north-korea-and-sanctions/4616300
Basically, engage rather than respond to them. We need to break the cycle provocations/response at some point. Possibly link a stop of threats to a growth in aid over time? a reduction of sanctions? Then link any increase in provocations to the opposite as well?
- present all a wide range of options at next meeting. Figure out whether they are just looking for attention/aid? whether they simply aren't going to except anything? and are simply going to be a nuisance for a short while... if it is the latter would be looking carefully elsewhere.
- if it is the case that we aren't really dealing purely with Kim Jong Un then we should be thinking about those people are all 'pulling the strings'? if my reading of the background of some of the people who may be 'pulling the strings' is correct then we may need to factor in other issues as well. Personal experience indicates that that people who have been under intense stress, wars, famine, etc... often have an extremely tarnished view of the world. Factor this in as well...
- are they ratcheting things up because they are trying to solidify or is this going to be the tone of things to be come? support a possible uprising? chances of success (note difference between Mail and Iraq/Syria. Support was clear in Mali and we intervened early. Highly unlikely this is going to be a 'clean operation')?
http://www.abc.net.au/news/2013-04-10/my-life-as-a-north-korean-super-spy3a-exclusive/4621358
http://www.abc.net.au/news/2013-04-10/spy-says-threats-are-to-prop-up-new-president/4621842
http://www.smh.com.au/world/kim-jongun-struggling-former-north-korean-spy-20130410-2hlwx.html?google_editors_picks=true
http://www.businessinsider.com/north-koreas-army-erupted-in-deadly-clashes-before-kim-jong-un-took-command-2013-4?IR=T
- if the regime is at breaking point? does he simply need a way out of this for himself and other members of the regime?
- if Iran/North Korea are co-operating/distracting international community efforts for arms control then it's likely that messages are going to be 'massaged' as well. Factor this in. Use what we have learnt in past confrontations. Don't just give up, poke, prod, learn, feel...
- if you honestly believe that he is going trying to solidify things (with a chance of piece down the line) suggest you make the offer big and credible but not enough to make us look 'weak'. That will only encourage further provocations.
- look at trying to increase the size of the buffer zone if at all possible. That way we can reduce the chances of misunderstandings/accidents in future. You can't shoot/provoke someone if they aren't within range.
- if you want to ratchet it down, consider ratcheting down a lot... A simple re-schedule is unlikely to be enough. Something that can be seen to be a genuine concession. If they are to de-nuclearize the concessions are probably going to be high/almost unpalatable. This is more than just a regional problem. China, Japan, South Korea, United States, and other neighbours are all vital to the world's interests from both political, military, economic, and other interests. Hope that the if peace can be negotiated the burden of re-building North Korea is going to shared by all.
- reading further and clear that re-unification is unlikely going to be smooth/easy and if it is going to happen it's going to be in the distant future. It will take time. Don't try to do too much at once but don't give up an short/medium term stability. Many barriers are going to have to be broken down. Consider 'PSYOPS' type operations. Broadcast international media into North Korea, drop leaflets, etc... Try to ensure that it's not just propoganda. Try to make sure that there is no threat of invasion unless provoked. If we are to give aid make sure that it's the type of aid which can not be re-used for dual purposes. Make sure that it is the type of aid that can only be used to help the citizens of North Korea and ensure that they know where exactly it's coming from. Be more aware of the implcations of some of sanctions that have been imposed. Try to make it targeted towards the regime rather than the people. Done incorrectly it will just harden their resolve and case against us. Be aware that like Iran they have 'hardened' their economy against sanctions and it's likely that anytime you do ratchet it up their likely to simply take it away from the people. Keep in mind that the UN and international laws have not caught up or are applicable to our circumstances. In this case, we have to consider alternative options...
http://www.guardian.co.uk/world/2013/apr/08/north-korean-soldiers-joint-drills?cmp=wp-plugin
http://www.news.com.au/world-news/north-korea-propoganda-sees-population-in-a-permanent-war/story-fndir2ev-1226618447623
- if there is an issue of pride/face at stake consider sending aid via China. History seems to play a more important role in Asia then in some of the cultures that I have most often been exposed to.
http://rendezvous.blogs.nytimes.com/2013/04/10/missiles-marathons-memorial-stones-figuring-out-north-korea-and-china/
http://www.independent.ie/incoming/china-and-russia-urge-north-korea-to-step-back-from-missile-launch-29187829.html
http://www.guardian.co.uk/commentisfree/2013/apr/10/korea-focus-china-versus-japan-oil
- believe that more work needs to be done into exactly why Kim Jong Un was chosen to be North Korea's new leader. Don't think that this is as simple as it first appears.
http://en.wikipedia.org/wiki/North_Korea
- history indicates that no countries that possess nuclear weapons have been invaded. Need to see how they view the rest of the world. Work back from there...
http://www.globalresearch.ca/does-north-korea-need-nuclear-weapons/5323227
http://www.washingtonsblog.com/2012/10/the-real-reason-america-used-nuclear-weapons-against-japan-to-contain-russian-ambitions.html
- delivery of message is poor in some cases. If someone like me is analysing your responses it can be guaranteed that there will be an army of staff on their side analysing the way you deliver your messages. Nuance/inflections points are important in guaging the mood of someone and their conviction behind the message being conveyed.
http://www.thestar.com/opinion/commentary/2013/04/10/china_losing_patience_with_north_korean_antics.html
- if considering change of regime think about Libya/Syria. Not going to be smooth. Believe that the following quotes are relevant, "it was once said of Prussia that it wasn't a country that had an army, but an army that had a country. And North Korea is a garrison state, a society organized for war", and "the conventional army loses if it does not win. The guerrilla wins if he does not lose."
http://www.vanityfair.com/politics/features/2001/01/hitchens-200101
http://www.nytimes.com/2013/01/31/opinion/global/will-syria-bleed-hezbollah-dry.html
- China and other countries need to understand that while territory does play an important role in defense it is pointless unless you have some relative control over it. It is in China's best interests that they bring North Korea under control during peacetime than during war. Moreover, with some of the weapons in circulation and under development now, North Korea could be (depends on the level of risk you're willing to take) rendered fairly useless in the early part of any campaign. The strength, survival, growth, and stability of North Korea is important for both itself as well as that of it's neighbours so don't look at this whole situation like it's not your problem. Allies (or even 'attack dogs') who can not be brought to heal are just as dangerous for their owners as well as strangers/enemies. Moreover, while China plays an important cog in the world economy they should realise that they aren't indispensable. Others can and are likely willing to take their place. Continued military provocations can only serve to hinder relations and future trade between them and the rest of the world. Peace is in everyones best interests.
http://www.bbc.co.uk/news/world-asia-china-22104024
http://zeenews.india.com/news/world/german-foreign-minister-warns-north-korea-playing-with-fire_841155.html
http://www.news.com.au/world-news/united-states-and-south-korean-armed-forces-placed-at-vital-alert-watchcon-2/story-fndir2ev-1226617936354
http://www.afr.com/p/world/us_will_target_north_korea_missile_ZVV7wlJX9YD1SdpTv3ZqUN
http://abcnews.go.com/Politics/wireStory/admiral-north-korea-direct-threat-us-18913130
http://www.reuters.com/article/2013/04/10/us-korea-usa-china-idUSBRE93903U20130410
http://edition.cnn.com/2013/04/09/world/north-korea-us-intel/?hpt=hp_t2
http://www.informationweek.com/security/attacks/north-korea-behind-bank-malware-south-ko/240152644
http://www.theage.com.au/comment/north-korean-nuke-test-may-keep-lid-on-crisis-20130410-2hlmg.html
http://www.nytimes.com/2013/04/12/world/asia/north-korea-tensions.html?_r=0
http://thecable.foreignpolicy.com/posts/2013/04/02/nobody_home_at_the_state_department
http://www.foreignpolicy.com/articles/2013/04/09/how_to_detect_a_nuclear_test_on_your_iphone
http://world.time.com/2013/04/09/chinas-long-fruitless-history-of-irritation-with-north-korea/
http://www.usnews.com/opinion/blogs/world-report/2013/04/09/making-sense-of-north-koreas-peculiar-madness
http://e-ring.foreignpolicy.com/posts/2013/04/09/why_doesn_t_seoul_have_iron_dome
http://www.csmonitor.com/USA/Military/2013/0409/Top-admiral-worries-North-Korea-crisis-could-escalate-pretty-quickly
http://www.latimes.com/news/nationworld/world/la-fg-norkor-missile-20130410,0,1321213.story
http://www.theaustralian.com.au/news/world/north-korea-shifts-missiles-in-attempt-to-outwit-intelligence/story-e6frg6so-1226618332121
Categories: FLOSS Project Planets

[one-liner]: Free Online Programming Courses

Tue, 2013-04-09 20:12
Background

This post is intended to capture various online resources for taking classes and/or getting training in anything. They’re predominately programming language and software engineering courses but their are other tracks that focus on history and chemistry, for example.

Solution

This is by no means meant to be an exhaustive list, it’s a clearinghouse of the different resources as I come across them.

General Sites

General Programming Courses

HTML/Javascript/Web/etc.

Ruby

NOTE: For further details regarding my one-liner blog posts, check out my one-liner style guide primer.

Categories: FLOSS Project Planets

Review: Real Mermaids Don’t Need High Heels

Tue, 2013-04-09 07:55


Real Mermaids Don’t Need High Heels by Helene Boudreau

My rating: 4 of 5 stars

Book three of the Real Mermaids series read. This one had a good deal of action and mystery that it did and a coming together of friends at the end. What more could an adolescent girl ask for? There is even some headier romance. I will say, Boudreau has done another great job and the book kept me interested too. I look forward to reading the fourth novel in the very near future!



View all my reviews

Categories: FLOSS Project Planets