Skip to main content

a silhouette of a person's head and shoulders, used as a default avatar

Dual Boot configuration for Windows 10 and openSUSE with full UEFI and Secureboot support

Questions and preamble

As has become normal, the FOSS/Linux community is peppered with anxiety over yet another major change to the tech landscape issuing forth from Redmond. With the release of Windows 10 comes a great many questions for the thoughtful, and this is especially true for our very own Linux communities. With gratitude we can recall our own past relief upon discovering that UEFI and Secureboot are not the herald of the end-times we had feared them to be. That being so does not however relieve the question of safely upgrading our dual-booting computers to Windows 10 without losing our ability to run Linux in tandem.

Excitement for Windows 10 was largely absent in me. I had grown quickly comfortable to the Windows 8.1 work-flow as it shared some similarities in those key areas which I had already grown to love in the GNOME Shell. Further, Windows served a role limited to usage for proprietary software that I deemed not sensible to coax into service on a Linux OS. However it did make sense for me to upgrade for my employment as a repair technician. It seems incumbent on me to familiarize myself with the upgrade process and the general operation issues of Windows 10.

Can I perform the upgrade safely?

In short, yes. Performing an in-place upgrade of your present Windows operating system will not overwrite your Linux partitions. However, the necessary Boot Configuration Data settings directing the UEFI firmware to use GRUB for booting will be lost. The Windows Boot Manager will be reasserted. This can be changed from within Windows using bcdedit.

How about a fresh installation?

Some users prefer to make a clean installation of their operating systems instead of in-place upgrades. Unlike in older versions of Windows, you can direct Windows 8 and above to specific partitions. This means that whether you wish to install Windows first in sequence or not is inconsequential; you can now install Linux first without worrying about the Windows installer overwriting it. 

One minor caveat however is that if you are not using a computer with UEFI firmware instead of a BIOS, GRUB will need to be installed after the Windows installation. 

Can I still get the free Windows 10 upgrade even if I want to cleanly install it? 

Yes. However, you will need to initiate the in-place upgrade for Windows 10 in your already present qualifying Windows 7, or 8.1 installation. As +How-To Geek says in their article, "When you upgrade a Windows 7 or 8.1 system to Windows 10, the installer confirms that you have a “genuine Windows” system installed and activates your computer for use with Windows 10. Note that you don’t actually get a Windows 10 product key — instead, your computer’s hardware is registered with Microsoft’s servers. When you install Windows 10 on that PC again in the future, it will check in with Microsoft’s servers, confirm it’s installed on a registered PC, and automatically activate itself."

How to install Linux alongside Windows 10

Prepare your hard drive

If you've performed a clean installation and installed openSUSE first in sequence, then drive preparation is irrelevant for your consideration. Note: if you intend to install openSUSE to a separate drive on a computer with UEFI, the  /boot partition must be placed on the primary drive with the Windows partitions.

Create free space

Though there are different ways this can be achieved, I advocate the following as the safest method. Creating free space should be simple if you have freshly installed Windows 10 instead of performing an in-place upgrade.

In Windows, open the Disk Management module from the Control Panel. You can find this simply by searching for it from the Start Menu/Cortana. Select your Windows partition (this is probably C:\ and the largest) and right click. The context menu will show an option to "Shrink Partition." Select this, and specify the size you would like.

If Windows is not allowing the amount of space you would like for your openSUSE installation, you can try clearing your temp files with a utility (I use Glary Utilities) and rebooting. If this still does not work, you can use an advanced utility such as PerfectDisk by Raxco which has a special mode specifically for preparing the partition for shrinking.

Now Install

Now simply use your install media such as DVD or bootable USB to install openSUSE. I will not detail this as it is easy. See our Installation Portal for more details. 


Post-installation configuration (critical)

Finally there are a couple things you must do to get your dualboot working properly with GRUB. If installing the latest openSUSE (LEAP 42.1) you will need to update your system completely. 42.1 contained a regression which did not chainload the Windows bootloader correctly, preventing you from using your Windows system. I prefer to update with zypper from the command line interface:
"sudo zypper up"
Now reboot, and you should be able to successfully boot into your Windows system. From GRUB, select the Windows entry since the next steps will need to be taken from within Windows. Though the same changes can be applied from within openSUSE, I find it much simpler to do from within Windows.

Optional step necessary for a few rare systems.
Now from your Windows 10 desktop, right click the Start Menu. From the context menu that comes up, select "Command Prompt (Admin)." A black Windows Command Prompt box will come up. Now insert the following line into the command prompt:
"bcdedit /set {bootmgr} path \EFI\opensuse\shim.efi"
This line will instruct the computer's firmware (EFI which is the successor to the BIOS) to use openSUSE's GRUB boot loader.

And that's it. Have a lot of fun!
a silhouette of a person's head and shoulders, used as a default avatar

Why I use openSUSE over other distributions.

The below is a response to a Facebook query on why we use openSUSE over Ubuntu. I was happy with how it turned out and thought it could prove helpful to a larger audience.


There are a great number of reasons why we use openSUSE. Ultimately, what one prefers boils down to personal taste. I'll tell you why I use openSUSE.

1) YaST:

YaST is our system administration tool. It can be used both in graphical environment and on the command line. YaST has modules for managing an enormous number of things, such as /etc/sysconfig configuration files and systemd processes to boot loader configuration and repository management. YaST provides comfortable, safe tools for working with important parts of the system that would otherwise be difficult, confusing, and potentially dangerous.



2) zypper:

Our package manager is called zypper. It has the most advanced dependency resolution available of any package manager whether it be Linux or another operating system. What this means is that it is trivial for us to perform complex installations and configurations that would be difficult or impossible elsewhere. In my experience with Ubuntu, I've had several instances where apt resolved a problem by removing X entirely, which broke the GUI system and was difficult to repair. In openSUSE, zypper prevents this sort of thing from happening.

3) Desktops; 

On openSUSE all Desktop Environments (such as Gnome, KDE, etc.) are treated equally, and can coexist on the same installation. Installing a new desktop environment is no more complex than installing any other package. Once they are installed, they can be selected from a dropdown on the login screen. Other distributions typically rely on 'spins' for delivering alternative desktop environments, such as Ubuntu Gnome. Part of why we can do this is that zypper has superior logic, and can handle this complexity better than other package managers.

4)Help; 

The openSUSE community is famed for its responsive and competent forums. Rarely is a user left without a solution for more than a day. Competent professionals and developers answer user questions in the relevant forums. Our community is friendly and helpful.

5)KDE and Gnome; 

openSUSE is famed for having one of the most stable and well integrated KDE environments of any distribution. Less well known is our incredibly well done Gnome implementation as well, which is what I prefer and am always happy with the job our team does.

6) OBS; 

Our Open Build Service gives users and developers a common place to build and share their software with the entire community. OBS works in concert with our online software.opensuse.org portal to allow easy Direct Install (formerly One-Click) of any software built on OBS. Direct Install will automate the adding of repositories, resolution of dependencies, and installation of the software. This makes otherwise complex or time consuming tasks swift and trivial. It also allows for an ever expanding library of software, and the distribution of complex packaged solutions in the form of YaST meta-packages.

In conclusion, though Ubuntu claims to be the most user-friendly, I find that claim to be unjustified. I've always found it to be more prone to breakage. And once there is a problem, it is much harder to fix than it would be in openSUSE since we have YaST and don't often need to rely on the command line or manually editing text configuration files.

a silhouette of a person's head and shoulders, used as a default avatar

7 cups of tea – Product review

Juggling between homework, working on my part time job and searching for a full time sums up my life. As I try to balance my life, there are slumps when I wished I had someone to vent out my frustrations to. But then, everyone is so busy that no one has time for anyone. If a friend has time to talk to you, can I be sure that they won’t judge you for having this super awkward conversation which no one wants to talk about? I can not be sure about this. I wished to have someone to talk outside my peer group, hopefully immediately without scheduling an appointment and without getting judged will provide a bit of support when I needed it the most.

After talking to my peers, I found out that I was not alone. A major portion of undergraduates and graduate students alike report mental stress or related issues because of increasing workloads. As they combat these mental and emotional stress, they want an outlet to vent out their feelings without being judged by their peers. Campus resources are inadequate as they are coupled with long waits. Students have to wait for weeks before making an appointment with the campus psychological services. During these wait times, if the issues are not solved, they get exacerbated.

This was when I was came across 7 Cups. 7 Cups is an on-demand emotional health and well-being service that connects people anonymously with trained listeners. By using this service, people can

  • talk to someone who will not know them
  • talk to groups of people anonymously who have faced the same problem regulated by a listener.
  • talk on various topics ranging from mental disorders to daily activities like College Life.
  • can get some help when they are waiting to be counselled by a professional counselor.

 


The ability to talk to people about various stress sources / mental disorders was incredibly useful. To validate my hypothesis that the application might be useful, I tried it a couple of times and spoke to a listener. I felt lighter and better after our conversation. So, I spoke to various students around the campus and see what they felt about handling stress. Out of the 18 students I spoke to, I received at least 3 or more students who shared that having an outlet will be useful.

Students quoted

[…]the times when I can’t get over the hump on my own, I wish I had someone there to give me just the motivation I needed.

It would  be nice to talk to people, but maybe not here

“Sleep helps, talking to people helps, putting things in perspective also helps.”

Help yourself section

7 cups also provides a set of resources for its users when they do not want to talk to anyone but are looking for specific strategies or resources that can help them manage their problems on their own.

The Help Yourself section provides

  1. a set of exercises that the users can use for self improvement
  2. forums where they can ask questions
  3. self-help guides that students can refer when they want to

 

 

Customized Portals

7 cups has customized portals that identifies the needs of specific communities. Identifying their needs is important as different communities will have different problems. Couples running households will have different problems and invariably face stress in a different form than teenagers. While the categories address that, 7 cups of Tea has extended the same notion beyond categories and come with customized portals.

They have launched a customized portal for startups where startups can talk to list for listeners who are trained to listen to entrepreneurs. Along with that,  they have customized resources where they can look for help that can improve their daily lives, relationships with families and friends across.

Directly quoted from their website, we find that even when entrepreneurs go through depression and other problems.

The ups and down of startups are often compared to a roller coaster. The downs can be really rough. Talking to others who have gone through what you are going through can really help. – JESSICA LIVINGSTON, Partner, Y Combinator

Most of my life I have struggled with depression. I’ve written about it, talked about it, coached and listed to others fighting with it. It’s a horrible isolating and debilitating condition. – Zak Homuth, Co-Founder & CEO, Upvert

My wish – Customized portals for Universities

Over the past few months, I have spoken to over 30 students by conducting formal interviews or randomly surveying them in the hallways, I have realized that there is an urgent need, and universities create a unique environment that contribute to stress for students.  Having customized portals for universities can go a long way in helping students combat daily emotional and mental sources of stress.

Research at the University of Michigan suggests that different student population react differently to stress. A study led by Prof. Daniel Eisenberg, approximately one-third of college students experience a mental health issue at some point. However, only 10 percent of student athletes with depression or anxiety take advantage of mental health resources – as compared to 30 percent of students overall.  Students at campuses often face different kind of stress that can be because of their academics, gender, sexual orientation, race etc.

Repeatedly, from the user interviews I conducted, I found that students needed an outlet to share their feelings. Customized portals for Universities will not only make listeners aware of the issues at the University, but will also help them tailor their conversational skills for the community groups. Additionally, universities can provide more training opportunities for students who are enrolled in their Social Work program to make them better future counselors.

Not only does it makes sense for 7 Cups to have separate portals for Universities, research shows that it makes business sense for Universities to trial run new emotional well being and mental wellness services. A revenue model developed by Prof. Eisenberg shows the potential loss for students who drop out of college because of stress and the loss in revenues. The example table at the end of the post shows that student productivity is lost valued at $3,125,000. The university fails to make an additional $ 1,562,500 revenue per year because of students dropping out.

There are other products like Breakthrough which provide confidential counselling, however 7 Cups differentiates themselves from other competitors by

  1. Pricing their product for free and opening up premium features at a very low cost (7.99$ / month for a year’s package).
  2. They provide active listening services and in no way a replacement to real counselling. The listeners are explicitly asked to not give advice, prescribe medicines to their clients and refer their clients to a counselor / psychiatrist in such cases.

On a concluding note, I find 7 cups a very interesting product in an interesting space, and is trying to solve a much needed problem that is often not realized or talked about in public spaces. By leveraging technology, 7 Cups can potentially change a lot of interactions in the mental health community.  Despite all of the positives, products like 7 Cups should be used with a pinch of salt. Users might not realize and start seeing their listeners as mental health providers. In this process, the users might start avoiding mental health providers and their issues can get worse. 7 Cups and other services should make it exceedingly clear that they are not professional mental health providers but an individualized support system where they provide help to their users. Coupling these services with professional counselors and mental health providers can go a long way. Services like 7 Cups can provide a stand-by when users wait to seek help from experts.

Appendix

  • Example Table (ref from Prof. Eisenberg’s revenue model)

revenue_rate.PNG

  • Thanks to Nick Sands and Mitchell Boldin from School of Information, University of Michigan who helped me with the user interviews.
  • This blog post is part of the application process for KPCB Product Fellows
  • This blog post was posted on Indian Standard Time.
  • I will be working with 7 Cups over the next 2.5 months to test their products at the University of Michigan as a Product Management Intern. The research has been done independently and has no association with 7 Cups.

the avatar of Jigish Gohil

Running live image from RAM

Some time back I wrote a patch to KIWI that allows running openSUSE live entirely from RAM(tmpfs).

How to use it?
Pass “toram” parameter at the boot menu. Try it on Li-f-e.

Benefits:
Running the OS from RAM make it lot more responsive than running from DVD or USB device, for example it is most useful for running a demo computer where many users try lot of applications installed in the live system. USB or the DVD can be ejected once the OS is loaded. It can be used to load OS to RAM directly from iso in a virtual machine as well.

Caveat:
Needs enough RAM to copy the entire iso to RAM and then some spare to operate the OS, Li-f-e for instance would need minimum 5G RAM available. It also takes a bit longer to boot as the entire image is copied to RAM.

a silhouette of a person's head and shoulders, used as a default avatar

Rio

I was really pleased to see Endless, the little company with big plans, initiate a GNOME Design hackfest in Rio.

The ground team in Rio arranged a visit to two locations where we met with the users that Endless is targeting. While not strictly a user testing session, it helped to better understand the context of their product and get a glimpse of the lives in Rocinha, one of the Rio famous favelas or a more remote rural Magé. Probably wouldn't have a chance to visit Brazil that way.

Points of diversion

During the workshop at the Endless offices we went through many areas we identified as being problematic in both the stock GNOME and Endless OS and tried to identify if we could converge on and cooperate on a common solution. Currently Endless isn't using the stock GNOME 3 for their devices. We aren't focusing as much on the shell now, as there is a ton of work to be done in the app space, but there are a few areas in the shell we could revisit.

GNOME could do a little better in terms of discoverability. We investigated the role of the app picker versus the window switcher in the overview and being able to enter the overview on boot. Some design choices have been explained and our solution was reconsidered to be a good way forward for Endless. Unified system menu, window controls, notifications, lock screen/screen shield have been analyzed.

Endless demoed how the GNOME app-provided system search has been used to great effect on their mostly offline devices. Think "offline google".

Another noteworthy detail was the use of CRT screens. The new mini devices sport a cinch connection to old PAL/NTSC CRT TVs. Such small resolutions and poor quality brings more constraints on the design to keep things legible. This also has had a nice effect in that Endless has investigated some responsive layout solutions for gtk+ they demoed.

I also presented GNOME design team's workflow, and the free software toolchain we use. Did a little demo of Inkscape for icon design and wireframing and Blender motion design.

Last but not least, I'd like to thank the GNOME Foundation for making it possible for me to fly to Rio.

the avatar of Kohei Yoshida

LibreOffice mini-Conference 2016 in Osaka

Night view in Osaka, overlooking the Metropolitan Expressway.
Night view in Osaka, overlooking the Metropolitan Expressway.

Keynote

First off, let me just say that it was such an honor and pleasure to have had the opportunity to present a keynote at the LibreOffice mini-Conference in Osaka. It was a bit surreal to be given such an opportunity almost one year after my involvement with LibreOffice as a paid full-time engineer ended, but I’m grateful that I can still give some tales that some people find interesting. I must admit that I haven’t been that active since I left Collabora in terms of the number of git commits to the LibreOffice core repository, but that doesn’t mean that my passion for that project has faded. In reality it is far from it.

There were a lot of topics I could potentially have covered for my keynote, but I chose to talk about the 5-year history of the project, simply because I felt that we all deserved to give ourselves a lot of praises for numerous great things we’ve achieved in this five years time, which not many of us do simply because we are all very humble beings and always too eager to keep moving forward. I felt that, sometimes, we do need to stop for a moment, look back and reflect on what we’ve done, and enjoy the fruits of our labors.

Osaka

Though I had visited Kyoto once before, this was actually my first time in Osaka. Access from the Kansai International Airport (KIX) into the city was pretty straightforward. The venue was located on the 23th floor of Grand Front Osaka North Building Tower B (right outside the north entrance of JR Osaka Station), on the premises of GMO DigiRock who kindly sponsored the space for the event.

Osaka Station north entrance.
Osaka Station north entrance.

Conference

The conference took place on Saturday January 9th of 2016. The conference program consisted of my keynote, followed by four regular-length talks (30 minutes each), five lightning talks (5 minutes each), and round-table discussions at the end. Topics of the talks included: potential use of LibreOffice in high school IT textbooks, real-world experiences of large-scale migration from MS Office to LibreOffice, LibreOffice API how-tos, and to LibreOffice with NVDA the open source screen reader.

After the round-table discussions, we had some social event with beer and pizza before we concluded the event. Overall, 48 participants showed up for the conference.

Conference venue.
Conference venue.

Videos of the conference talks are made available on YouTube thanks to the effort of the LibreOffice Japanese Language Team.

Slides for my keynote are available here.

Hackfest

We also organized a hackfest on the following day at JUSO Coworking. A total of 20 plus people showed up for the hackfest, to work on things like translating the UI strings to Japanese, authoring event-related articles, and of course hacking on LibreOffice. I myself worked on implementing simple event callbacks in the mdds library, which, by the way, was just completed and merged to the master branch today.

Many folks hard at work during hackfest.
Many folks hard at work during hackfest.

Conclusion

It was great to see so many faces, new and old, many of whom traveled long distance to attend the conference. I was fortunate enough to be able to travel all the way from North Carolina across the Pacific, and it was well worth the hassle of a jet lag.

Last but not least, be sure to check out the article (in Japanese) Naruhiko Ogasawara has written up on the conference. The article goes in-depth with my keynote, and is very well written.

Other Pictures

I’ve taken quite a bit of pictures of the conference as well as of the city of Osaka in general. Jump over to this Facebook album I made of this event if you are interested.

a silhouette of a person's head and shoulders, used as a default avatar

Why I Strive to be a 0.1x Engineer

There has been more discussion recently on the concept of a “10x engineer”. 10x engineers are, (from Quora) “the top tier of engineers that are 10x more productive than the average”

Productivity

I have observed that some people are able to get 10 times more done than me. However, I’d argue that individual productivity is as irrelevant as team efficiency.

Productivity is often defined and thought about in terms of the amount of stuff produced.

“The effectiveness of productive effort, especially in industry, as measured in terms of the rate of output per unit of input”

Diseconomies of Scale

The trouble is, software has diseconomies of scale. The more we build, the more expensive it becomes to build and maintain. As software grows, we’ll spend more time and money on:

  • Operational support – keeping it running
  • User support – helping people use the features
  • Developer support – training new people to understand our software
  • Developing new features – As the system grows so will the complexity and the time to build new features on top of it (Even with well-factored code)
  • Understanding dependencies – The complex software and systems upon which we build
  • Building Tools – to scale testing/deployment/software changes
  • Communication – as we try to enable more people to work on it

The more each individual produces, the slower the team around them will operate.

Are we Effective?

Only a small percentage of things I build end up generating enough value to justify their existence – and that’s with a development process that is intended to constantly focus us on the highest value work.

If we build a feature that users are happy with it’s easy to count that as a win. It’s even easier to count it as a win if it makes more money than it cost to build.

Does it look as good when you its compare its cost/benefit to some of the other things that the team could have been working on over the same time period? Everything we choose to work on has an opportunity cost, since by choosing to work on it we are therefore not able to work on something potentially more valuable.

Applying the 0.1x

The times I feel I’ve made most difference to our team’s effectiveness is when I find ways to not build things.

  • Let’s not build that feature.
    Is there existing software that could be used instead?
  • Let’s not add this functionality.
    Does the complexity it will introduce really justify its existence?
  • Let’s not build that product yet.
    Can we first do some small things to test the assumption that it will be valuable?
  • Let’s not build/deploy that development tool.
    Can we adjust our process or practices instead to make it unnecessary?
  • Let’s not adopt this new technology.
    Can we achieve the same thing with a technology that the team is already using and familiar with? “The best tool for the job” is a very dangerous phrase.
  • Let’s not keep maintaining this feature.
    What is blocking us from deleting this code?
  • Let’s not automate this.
    Can we find a way to not need to do it all?

Identifying the Value is Hard

Given the cost of maintaining everything we build, it would literally be better for us to do 10% the work and sit around doing nothing for the rest of our time, if we could figure out the right 10% to work on.

We could even spend 10x as long on minimising the ongoing cost of maintaining that 10%. Figuring out what the most valuable things to work on and what is a waste of time is the hard part.

a silhouette of a person's head and shoulders, used as a default avatar

HOWTO: Configure 389-ds LDAP server on openSUSE Tumbleweed

Recently I’ve been setting up LDAP authentication on CentOS servers to give a shared authentication method to all the compute nodes I use for my day job. I use 389-DS as it’s in my opinion much better to administer and configure than openLDAP (plus, it has very good documentation). As I have a self built NAS at home (with openSUSE Tumbleweed), I thought it’d be nice to use LDAP for all the web applications I run there. This post shows how to set up 389 Directory Server on openSUSE Tumbleweed, including the administration console.

(Obligatory) disclaimer

While this setup worked for me, there’s no guarantee it will work for you. If something breaks, you get to keep all the pieces. With some adjustments (repo names etc) this might also work on openSUSE Leap 42.1, but I haven’t tested it. Use these instructions at your own risk.

Prerequisites

Your machine should have a FQDN, either a proper domain name, or an internal LAN name. It doesn’t really matter as long as it’s a FQDN.

Secondly, you need to tune a couple of kernel parameters to ensure that the setup won’t scream at you for lack of available resources. In particular, you’ll need to raise the ranges of local ports available and the number of maximum file descriptors. You can easily do that by creating a file called /etc/sysctl.d/00-389-ds.confwith the following contents:

# Local ports available
net.ipv4.ip_local_port_range = 1024 65000
# Maximum number of file handles
fs.file-max = 64000

After adding it, issue sysctl -p as root to apply the changes.

Installing 389 Directory Server

Afterwards, we’ll need to add the network:ldap OBS project, as in particular the admin bits of 389 aren’t yet available in Tumbleweed. Bear in mind that adding third-party repository to a Tumbleweed install is unsupported.

zypper ar -f obs://network:ldap Network_Ldap
# Trust the key when prompted
zypper ref

The obs:// scheme automatically adds the “guessed” distribution to your repository (with Leap it might fail though, so beware). Then we install the required packages:

zypper in 389-admin 389-admin-console 389-adminutil 389-console 389-ds 389-ds-console 389-adminutil 389-adminutil-lang

Adjusting the configuration to ensure that it works

So far so good. But if you follow the guides now and use setup-ds-admin.pl, you’ll get strange errors and the administration server will fail to get configured properly. This is because of a missing dependency on the apache2-worker package and because the configuration for the HTTP service used by 389 Directory Server is not properly adjusted for openSUSE: it references Apache 2 modules that the openSUSE package ships builtin or with different names and thus cannot be loaded.

Fixing the dependency problem is easy:

zypper in apache2-worker

Then, we’ll tackle the configuration issue. Open (as root) /etc/dirsrv/admin-serv/httpd.conf, locate and comment out (or delete) the following line:

LoadModule unixd_module         /usr/lib64/apache2/mod_unixd.so

Then change the mod_nss one so that it reads like this:

LoadModule nss_module         /usr/lib64/apache2/mod_nss.so

Save the file and now you’ll be able to run setup-ds-admin.pl without issues. I won’t cover the process here, there are plenty of instructions in the 389 DS documentation.

After installation: fixing 389-console

If you want to use 389-console on a 64 bit system with openJDK you’ll notice that upon running it’ll throw a Java exception saying that some classes (Mozilla NSS Java classes) can’t be found. This is because the script looks in the wrong library directory (/usr/lib as opposed to /usr/lib64). Edit /usr/bin/389-console and find:

java \
    -cp /usr/lib/java/jss4.jar: # rest of line truncated for readability

and change it to:

java \
    -cp /usr/lib64/java/jss4.jar: # rest of line truncated for readability

Voilà!

389-console working

a silhouette of a person's head and shoulders, used as a default avatar

Bit shifting, done by the << and >> operators, allows in C languages to express memory and storage access, which is quite important to read and write exchangeable data.

Bit shifting, done by the << and >> operators, allows in C languages to express memory and storage access, which is quite important to read and write exchangeable data. But:

Question: where is the bit when moved shifted left?

Answere: it depends

Long Answere:

// On LSB/intel a left shift makes the bit moving 
// to the opposite, the right. Omg 
// The shift(<<,>>) operators follow the MSB scheme
// with the highest value left. 
// shift math expresses our written order.
// 10 is more than 01
// x left shift by n == x << n == x * pow(2,n)
#include <stdio.h> // printf
#include <stdint.h> // uint16_t

int main(int argc, char **argv)
{
  uint16_t u16, i, n;
  uint8_t * u8p = (uint8_t*) &u16; // uint16_t as 2 bytes
  // iterate over all bit positions
  for(n = 0; n < 16; ++n)
  {
    // left shift operation
    u16 = 0x01 << n;
    // show the mathematical result
    printf("0x01 << %u:\t%d\n", n, u16);
    // show the bit position
    for(i = 0; i < 16; ++i) printf( "%u", u16 >> i & 0x01);
    // show the bit location in the actual byte
    for(i = 0; i < 2; ++i)
      if(u8p[i]) 
        printf(" byte[%d]", i); 
    printf("\n");
  }
  return 0;
}

Result on a LSB/intel machine:

0x01 << 0:      1 
1000000000000000 byte[0] 
0x01 << 1:      2 
0100000000000000 byte[0] 
0x01 << 2:      4 
0010000000000000 byte[0] 
0x01 << 3:      8 
0001000000000000 byte[0]
...

<< MSB Moves bits to the left, while << LSB is a Lie and moves to the right. For directional shifts I would like to use a separate operator, e.g. <<| and |>>.

the avatar of Aleksa Sarai

Dockerinit and Dead Code

After running into insane amounts of very weird issues with gccgo with Docker, some of which were actual compiler bugs, someone on my team at SUSE asked the very pertinent question "just exactly what is dockerinit, and why are we packaging it?". I've since written a patch to remove it, but I thought I'd take the time to talk about dockerinit and more generally dead code (or more importantly, code that won't die).