Search This Blog

Wednesday, December 28, 2016

How to limit access to facebook

Sometimes the users are the ones to request help with the network nuisance known as facebook... (Don't get me wrong. Sometimes Facebook is great. But sometimes it is frustrating to discover how much of a resource sink it actually is). 

And thus I found myself answering the question: how to limit my exposure to facebook during working hours? 

The quick and easy reply:
Assuming you are using google chrome (and if you are not, why not?), there is a very easy and efficient method to block access to certain websites, either completely, or in certain times and days -
  • Install Chrom's Block-site extension 
  • Configure the extension as you wish -
    • Click its icon (the no-entry icon among the extensions icons)
    • under "blocked sites", define those websites whose usage you wish to limit
    • under "active days&times" choose the website, define time-frame and add.

That's it. the interface is very intuitive and the extension gets right to work...

I know that other people prefer other chrome extensions. Others won't touch chrome and are willing to go to war on behalf of another browser. If you are one of the supporters of Chrome's Stay- focused or of a completely different  solution - why don't you talk-back about it and tell us all about its merits? 

Friday, December 16, 2016

The importance of adding sitemaps to Google Search Console

Had a funny conversation with a friend a few days ago. He had been blogging for quite a while and suddenly discovered his posts have not been registered as indexed in Google's Search Console. 

It isn't that he has been completely aloof to SEO: 

But why didn't his posts get indexed? 
Now, first lets make something clear: there is a difference between the way Google Search Console looks on indexing and the actual indexing. It might be that the posts have been indexed and can be found using google search, but have not been acknowledged by Google Search Console. One way or the other, the simplest answer is also the accepted practice: always add sitemaps to Google Search Console. He didn't do it, because he did not think he needed to do it, as he did all his blogging on Google's own blogging platform of google blogger.

What is a sitemap, anyway? 
To make a long story short, We'll quote wikipedia on sitemaps
"A site map (or sitemap) is a list of pages of a web site accessible to crawlers or users...An XML Sitemap is a structured format that a user doesn't need to see, but it tells the search engine about the pages in a site, their relative importance to each other, and how often they are updated." 
How to add a sitemap for Google Blogger to Google Search Console? 
For google blogger, we use Google blogger's Atom. 
  1. Click on the blog for which you want to add sitemap.
  2. click on dashboard 
  3. clock on the ">>" icon in the sitemaps section 
  4. click on the red "ADD/TEST SITEMAP" button. 
  5. Add the following code in the text box: atom.xml?redirect=false&start-index=1&max-results=500 (what if you have more than 500 records? add several sitemaps, cutting the set to chunks using start-index and max-results) 

I'll use this opportunity to document this procedure for all the blogging platforms I've been working with. Not surprisingly, it is MUCH EASIER in other platforms: 

For tumblr: 
the same process, only in the text box, you should add both tumblr's own sitemaps:
sitemap.xml 
sitemap1.xml 

For Wordpress: 
the same process, only in the text box, you should add Wix's own sitemap:
sitemap.xml

For Wix: 
the same process, only in the text box, you should add Wix's own sitemap:
sitemap.xml

After-care
After you finish, go to Crawl/Sitemaps, and VERIFY that Google can actually reach the provided files. 

A few days later, come back. Why? 
  1. verify that no problems were found with your website 
  2. VERIFY that the expected number of URLs had been indexed... (under 



Thursday, November 17, 2016

Freeing space in windows 7 by cleaning some clutter

Once again my windows 7 server*  reached the below 10% on the root drive mark. 

Running WinDirStat showed me the larger folders, and a careful check brought me to the following folders as the lead nominees to begin with, if one wishes to clean windows7 from some clutter:

Before

\windows\logs\cbs 
This is where log files, knows as "CBS Persist logs" are created. Apparently Windows uses this folder to log installation, updates and configurations. According to a superuser discussion "The normal log goes to a file CBS.log, but to prevent, that the file gets too large Windows splits them into CBS Persist logs and later compresses them into CAB files". The files are safe to delete, and there is no point in keeping them as history logs, if you don't have any problems with installations or updates. I guess that on a high-availability production machine I'd be more careful, but here I Deleted all but the files bearing today's date.
The outcome: 20GB released !!! 

\windows\winsxs 
SXS stands for Side-by-side technology. It is also known as WinSxS or SxS, although technically WinSxS refers only to the global side-by-side store (officially called the "Windows component store"), which is conceptually the native equivalent of the .NET Global Assembly Cache. Executables that include an SxS manifest are designated SxS assemblies. (For some reason I was not able to get to Microsoft's english version of support for winsxs. This is the link for the winsxs hebrew support. What can you say about a company that uses wordpress for its support?) 

To sum it up: not the kind of folder you want to delete stuff from on your own. 
Does Microsoft offer any tool or detailed steps to clean it ? 
The answer in the past was as far as practical conduct goes, a shocking no
Theoretically speaking, Microsoft realized that it has to provide a way to clean the WinSXS folder through the clean-up wizard. But even though my windows has the relevant update the wizard does not have the promised button "clean up system files". You may try on your own machine, running the wizard the as administrator (assuming your windows is on your C drive, open up C:\Windows\System32, and then right click cleanmgr.exe). 
For me, it did not help... I didn't get the promised "clean up system files". 

\windows\temp 
This is a relatively simple delete everything folder, with the exception that if a file is used, just skip it. (I've never ran into a situation when the entire folder was deleted, unless I was in safe mode).

For some reason, the folder had 10GB of files in it,  even though I distinctly remembered clearing it a few months ago. Oh well.... 

Last step
make sure you empty the recycle bin (for some reason, pressing shift during delete did not make it thru as permanent delete).

After

After-thoughts
And we are at the 36% free space line... which means that despite winsxs being an annoying issue, I'll let it be for the time being. Windows peculiarities can take one a lifetime, and I prefer to invest that time being productive on other things. (yes, surprising as it may seem, one learns and grows. 10 years ago I would have spent an all nighter on this issue now I prefer to dedicate the time to a more interesting question: how the blip did my data folder got so inflated... but that shall be kept for 
another post ). 

(*)
yes, I know it might sound funny, but the living room entertainment station is also being used as a home server.
what kind of server tasks you wonder? storage, backup, a miscellany of virtual machines, and other stuff.
Storage, btw, does not mean this is a file server. I'm slowly planning to become more cloud-oriented, but for now the equal storage nodes of the house, relying on Dropbox for the synchronizing and the external backup, works quite well in my mind. It enables the usage of several stations around the house with several users, while data is kept synchronized in all nodes and I highly recommend it.


Tuesday, October 25, 2016

howto crudely override the uefi boot order on HP pavilion

As past readers of this blog may remember, this  hardware is not intuitive as far as work with  multiple os-loaders goes.  These days I'm mostly using Linux. still, on occasion I try thing on Windows, and an experiment gone wrong (how to minimize a Windows 10 partition) created a very sad situation in which Windows OS loader, which as far as UEFI cares has become the computer's OS-loader, was no longer able to boot into a functional Windows 10. I could have cared more, and use whatever recovery mean necessary to bring this computer's Windows installation to working order. But it just doesn't seem logical to put that time in. First - I have a well functioning Windows 7 working on another computer (for whatever needs of the communicating with the world variety). And second - because if I do any serious Microsoft-related work on this computer, it would be to install windows 7 on it (which would probably turn out a rather tedious task, considering the fact that it is a Windows8-era machine). 

All this introduction came as an attempt to explain that what I actually needed was to over-run the uefi boot order so that my linux would boot up first, and had no special need to get the entire uefi setup into order, or make sure that windows would be easy to boot into as well. 

A nice discussion on AskUbuntu provided the answer which summed up in short to a replacement of the efi boot file used to boot into the MS Os-loader, with the efi boot file used to boot into Grub (paths may vary according to specific installation). 

The steps: 
1. backup the Microsoft efi file 
    cd /boot/efi/EFI/Microsoft/Boot/
    sudo mv bootmgfw.efi bootmgfw.efi.bak
2. overwrite the Microsoft efi file with the grub file 
   sudo cp /boot/efi/EFI/ubuntu/grubx64.efi  bootmgfw.efi

And now the machine boots into Linux with no delays. 


Saturday, September 17, 2016

Getting 'attribute name "async" must be followed by =' when trying to implement "page level adsense" in google blogger ?

Page-level adsense has finally arrived to my location, and as I was tiredly embedding the code generated by adsense, I was surprised to receive the following notice: 
"Error parsing XML, line XXXX, column YY: Attribute name "async" associated with an element type "script" must be followed by the ' = ' character."

If you experience the same problem, don't fret. 
the solution is simple. 
Blogger expects XML, so we'll use XHTML, and instead of async, write the formal XHTML async="async". 

This means that your code should look like the following (pay atention that the google-client-ad has been changed): 

<script async="async" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
  (adsbygoogle = window.adsbygoogle || []).push({
    google_ad_client: "ca-pub-XXXXXXXXXXXXXXXX",
    enable_page_level_ads: true
  });
</script>
That is all that is required to make the code work. 

Thursday, August 25, 2016

How shall the Google Android O be named?

As I was using  a free moment to read a little about the new features of Google's most recent android, the Nougat, it suddenly hit me, that no so long into the future, Google is going to face a major obstacle. How shall the Google Android O be named? 

After all, there aren't that many globally recognized candies in the letter O.... recalling google's request for help regarding N - 
- an effort which has ended with the Nougat, it seems that it is high time to start pondering. 

Thinking about all sorts of pastries and candies is never a really bad thing. The answer shall not be found in the next wonderful collection:
An assortment of pastries and cakes in a pâtisserie
This image was licensed by a CC-by-SA 3.0 license on wikipedia
But wikipedia's fascinating article -  list of desserts can be very helpful. Going over it, it seems that a
solution may be found in one of the next interesting cuisines:
  • Ontbijtkoek - a Dutch spiced rye cake. 
  • Oblaat - a Japanese candy, made of a layer of starch that wraps candies
  • Orange jelly candy finger-sized sticks of soft jelly candy (a candy from Hong Kong)
  • Ozark pudding - a dry fruit custard with nuts (from the United States)
  • Oliebol - fried dumplings of a mixed origin (with a strong dutch-belgian ancestry claim)
  • Ox tongue pastry - a Chinese Doughnut of sorts 
  • Orange Whip - a sweet cocktail (most probably from the United States)
Naming is not always as important as one may claim in marketing. As amusing as gather stuff for this post was, It seems that nowadays, code names for operating system releases are of interest to the very few. In the public's point of view, Apple and Google may may very well choose to call their operating system new version "the one with the 5,734 updates" or "the one that finally solves that irritating limitation" and the same crowds shall flow. After all, they are all searching the hardware innovations. The software is more of an enabler. 

And yet, it seems that Android Nougat has brought some interesting news with it. I suspect I would have called it "the one with the ability to display multiple apps on-screen at once in a split-screen view".

Has multi-tasking finally arrived to the smartphones world ? Considering the replies one used to get on the iOS world not so recently (this reply regarding ipad and iphone or this support discussion on the Apple website), it seems that it wasn't a minute too soon...

Saturday, July 2, 2016

Set-up python 3.3 on centos 6.4

Preface:Older Linux releases usually don't include Python 3 in their repositories. They also rely heavily on Python 2. This means that installing Python 3 on an older CentOS is slightly more complicated. You don't realize it until you need it...

Due credit: When I started toying with Python 3.3 installation on one of my older CentOS machines, I ran into a post by O.S. Tezer at DigitalOcean . As Tezer focused on Python 2.7. I thought it might be useful for others to have a full python 3 howto. 

# Prepare the system for the compilation 
yum install -y zlib-devel openssl-devel sqlite-devel bzip2-devel xz-libs
# (xz-libs is for une unzipping of the source; a just-in-case installation)

# Get python source & compile 
wget http://www.python.org/ftp/python/3.3.3/Python-3.3.3.tar.xz  
# pay attention where you do this so that you don't clutter your system 
#unzip 
xz -d Python-2.7.6.tar.xz 
#untar 
tar -xvf Python-2.7.6.tar 
cd Python-3.3.3 
#configuration 
./configure
#build 
make 
#install
sudo make altinstall #we really, but really, don't want to alter the system's older version python 
#   the python executables are created by deafult in /usr/local/bin 
#  you might wish to add to your path or the system's path the python3.3 executable 
#  (/etc/profile.d  and/or $HOME/.bash_profile )

# Setting Up pip and virtualenv
# how to set setuptools 23.0.0
 https://pypi.python.org/pypi/setuptools
# (the no check certificate and insecure switches are required because of the ancient o/s )
wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py
sudo /usr/local/python3.3 ez_setup.py --insecure
#now lets get pip and install it 
wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py 
sudo /usr/local/bin/python3.3  get-pip.py
# at last we are at python's own land...
sudo /usr/local/bin/pip3  install virtualenv 





Friday, July 1, 2016

Slowly and surely the age of pervasive computing crept upon humanity

If found myself reading some pervasive computing news recently which reminded me that we are in the middle of a revolution. The two pieces were relatively innocent. 


Yes, the world of gadgets is getting smarter. When I wrote about the coming age of pervasive computing on this blog, more than 5 years ago I claimed that the age of pervasive computing has not come yet, and stated that only when all things, including everyday artifacts such as chairs, paintings and pens will be computerized,  shall that age truly come. I still hold firm  in this belief, but as time goes by, one has to admit that we are in a twilight age, a period where things are becoming less and less distinct. 

It reminds me of the old joke, "Slowly and surely the unix crept up on the Windows  user ..." (there are other variations, regarding other prey). Looking around, we see that joke fulfilled. The most common operating system in smartphones is Unix (more accurately, a Linux; more accurately: Android). 

This slow and sure creeping is now being performed by the age of pervasive computing. But what is the line-of-no-return? Surely not at this stage of early-bird gadgets, such as the Echo. 








Thursday, June 16, 2016

Revisiting installing guest additions on Virtual box for CentOS 7

Toying with docker, I found myself with an upgraded version of Virtual Box, and a new virtual machine brought me to the old issue of the pre-configuration needed for installing guest additions on CentOS 7. Things have become simpler: 

1) The Extra Packages for Enterprise Linux repository is now better embedded, and therefore the following suffices to define it:
     yum install epel-release 
2) Having the new repositry, we can easily install dkms
    yum install dkms 

And surprisingly, this solves all dependencies required for the guest additions... (at least it solved it for me, in a base+X installation). 

so afterwards, we can run the guest additions installer, and see it complete. 

Screen shot of the Installation of Virtual Box Guest Additions for Linux

Friday, June 10, 2016

האם תוכל לכתוב לי מהן הפקודות הבסיסיות ביותר ב - SQL בבקשה?

חבר שאל את השאלה "האם תוכל לכתוב לי מהן הפקודות הבסיסיות ביותר ב - SQL? ", כהכנה ליום עיון. גירדתי מעט בראש, ומאחר ולא היה לי זמן להתחיל לחפש מדריך בסיסי טוב באמת לSQL ברשת, חשבתי שיהיה הכי מהר לשרבט משהו בעצמי, אז שלחתי לו את התשובה הבאה (ואחרי ששלחתי, חשבתי שעדיף לשמור אותה כאן, למקרה הצורך):

1. אני ממליץ שתוריד ותתקין את הכלי הבא - SQLITE - מאוד פשוט לתפעול.
(מהקישור, מה שאתה צריך זה תחת Precompiled Binaries for Windows
את sqlite-tools-win32-x86-3130000.zip )

2. אחרי שתוריד, unzip אותו, תוכל להריץ את התוכנית sqlite3 .

3. בתמצית, SQL, שהיא כלי לעיבוד מידע, נחלקת לפקודות הגדרה, פקודות שליפה (יותר נכון, פקודת שליפה) ופקודות מניפולציה.  (זו אמירה גדולה ולא מדוייקת אבל מספיקה לשלב הראשוני הזה). מי שמבקש יותר יכול להציץ בערך ויקיפדיה של SQL.

הגדרה: create.
למשל בsqlite שהגדרנו, הקש את הפקודה הבאה:
create table t1 (n1 number, v1 varchar2(1000));

עיבוד: insert, update וdelete
למשל, בsqlite שהגדרנו, הקש את הפקודה הבאה:
insert into t1 values (1,'hello');

שליפה:  select
למשל, בsqlite שהגדרנו, הקש את הפקודה הבאה:
select * from t1;

ואם נצטט מתוך ויקיפדיה:
"משפט SELECT, מאחזר נתונים מתוך טבלה (או מספר טבלאות), אבל לא מבצע בהם שינויים קבועים.
DML - שפת מניפולציה בנתונים (Data Manipulation Language) - שפה המשמשת לטיפול בנתונים עצמם
משפט INSERT מוסיף שורות חדשות לטבלה.
משפט UPDATE מעדכן נתונים בשורות הקיימות בטבלה.
משפט DELETE מוחק שורות נתונים מטבלה".

4. כדאי להציץ בויקיפדיה, לראות כמה דוגמאות בסיסיות קצת יותר מתקדמות שמובאות שם. ובכל זאת, למען התמציתיות, כמה דוגמאות יחד עם הפלט מsqlite:

sqlite> insert into t1 values (2,'there');
sqlite> select * from t1;
1|hello
2|there

sqlite> update t1 set n1=3 where n1=1;
sqlite> select * from t1;
3|hello
2|there

sqlite> delete from t1 where v1='there';
sqlite> select * from t1;
3|hello

sqlite> insert into t1 values (4,'b la bla ');
sqlite> select * from t1;
3|hello
4|b la bla

sqlite> select * from t1 where n1=4;
4|b la bla

sqlite> select * from t1 order by n1 desc;
4|b la bla
3|hello

דברים שיכולים לעזור




Wednesday, May 25, 2016

Remembrance time: was your LinkedIn account caught up in the 2012 hack? will your _____ account be caught in the 2018 hack ?

It is never fun to discover that your identity has been stolen. This ZDNet article drew my attention to the recent exposure of the entire data set that was stolen on the great hack on LinkedIn that took place almost 4 years ago, on june 2012. 

Back than, in 2012, LinkedIn responded with commendable speed to that breach of security, and I remember receiving the following message on the day of the hack: 
warning email from linkedin, telling of the data breach

It is one thing to know that your data has been stolen, and another to know that it is still being a commodity. Following the article, I checked haveibeenpwned, and indeed, among other users, my identity is part of the LinkedIn hacking merchandise sold out there.... 

Still. it could have been worse. After all, the password in question was changed immediately after I received the warning. As sad as one might be about one's email being exchanged among malicious hackers. this does not change reality, it only clarifies it. 

Online existence has its prices. We have to install doors and windows in our homes if we wish to get out to the world or receive guests. We have to display an online presence if we wish to utilize the remarkable advantages of the Internet. The reminder of the existence of criminals is not a reason to be scared or to avoid things, it is just another reason to take care. 

Taking care means the following steps:
  1. Don't use the same password for different websites. I know it is hard. Don't. 
  2. Adopt a password regulation scheme, which should be especially rigorous regarding services in which you keep sensitive information. With 'rigorous' I include:
    1. password complexity;
    2. frequency of change;
    3. intelligent memorization/personal storage of your password. 

Further Reading 

Monday, May 16, 2016

Microsoft is finally joining the linux world ! (or - Bash on ubuntu on windows is not an April fool's joke)

Sometimes experience leads you astray. It happened to me about a month and a half ago, when I published the post "Bash on Windows". I was sure the recent Windows news about Microsoft providing a linux shell within windows were another classic April Fool's joke. 
turns out I was wrong.

But first, a little bit of apologetics:
I had good grounds for this assumption, in the form of past April Fool's jokes:
True, none of those jokes is in the same league of the now legendary clippy returns, and it is also true that Microsoft has been outperformed in the April Fool's caregory by Google for years. And yet, the combination of the timing and the content sent me to a completely wrong conclusion.

Now it is high time to state the correct facts.
In the last month accumulating pieces of technology news made me doubtful about that earlier liar-liar pants on fire call. A recent April 26th Microsoft blogs update made me realize that this news item is the real thing. 

Still, being a doubtful person, I wanted to see for myself if and how this works. So I followed the instructions on Microsoft developer that explain how to install "Bash on Ubuntu on Windows"
Naturally, it wasn't as swift and quick as one could have anticipated. Why? mainly because this bash on windows option is still in beta. 

So, what one has to do to install Bash on Microsoft:
1) Configure windows update so that it will deliver new Windows beta features, through Microsoft's Windows Insider.

Before I explain how to do that, let's stop for a minute.
Don't take this lightly.
Working with Windows Insider builds means that your entire workstation is working with a beta stage operating system.
Do this with your own judgement and care.
Me? I use Linux Mint most of the time nowadays, so what do I care if my Windows 10 gets less stable ?

Having decided to boldly go into Microsoft betas world, first you need to become a registered Windows Insider.
.
Afterwards, on your machine, open Settings \ Update & Security.
Click The "Advanced options".
Click the  "Get Started" button and sign in using your Microsoft Account and password (the one which you used to register into the Windows Insider program).
I don't know if it is universal, but my Windows thought it necessary to reboot at this stage.

Theoretically, you'd expect that afterwards Windows update would promptly bring you the latest builds in the insider program. But however frequently you are going to check for updates and new preview builds, they will take their time before they appear.

Windows update is its own master, it has its own pace (as following discussion - "windows 10 insider preview build 10240 not appearing on windows update" teaches).

My own personal experience? having configured everything to work with windows 10 insider, it took less than 24 hours but more than 12 before I got to see the following sight:

windows update downloading inside preview 14332

  (I know, I can go over Windows logs and find the accurate time. I have a life. Let's settle with 12-24, ok?)

 2) Now, with the build applied, go to Settings\Update&Security, choose "For developers" and choose the "developer mode" radio button.

 Afterwards, open “Turn Windows Features on or off” from the start menu, and configure windows to activate the option "Windows Subsystem for Linux (Beta)".

how to activate the option "Windows Subsystem for Linux (Beta)"

As always with Redmond's best -  a reboot shall be required after your "OK"...

Windows completes requested changes and needs to reboot


3) Having rebooted and returned, we can enter cmd (as admin) and execute bash for the first time... in which you shall be asked to confirm the license terms, and afterwards ms-bash will download and install the assortment of tools that is ubuntu (minus the kernel. this isn't about virtual machines, this isn't about an operating system to replace windows, this is more about windows emulating linux). 

command prompt image with download beginning


Afterwards, at the end of installation you are requested to provide a username and password. By this you are creating your user and password (for sudo and such). Write those down somewhere or memorize them.

download complete. we are asked to provide a UNIX username


You will need them. 

And then,
at last,
one can play a little with the new toy!

My first impressions - a rather messy and confused report on my first usage of Microsoft Bash. 
Line completion acts quite  like bash, but as far as complex folder names are concerned, it still has some window-ish drawbacks in it (try cd-ing into a folder with spaces in its name)

A small test with working with environment variables went quite well: 
export PS1="\u@\h:"

image of output of bash commands to dispaly and change environment  variable PS1


(I hate long prompts and I don't really trust them, so that they don't spare me the necessary pwd-ing)

Next, lets see if we can run something with dependencies. Although I can barely handle Emacs, being a vi person myself, lets try:
myuser@mycomputer:emacas
No command 'emacas' found, did you mean:
 Command 'emacs' from package 'emacs24-nox' (main)
 Command 'emacs' from package 'emacs23' (universe)
 Command 'emacs' from package 'emacs24' (main)
 Command 'emacs' from package 'e3' (universe)
 Command 'emacs' from package 'emacs23-nox' (universe)
 Command 'emacs' from package 'emacs23-lucid' (universe)
 Command 'emacs' from package 'emacs24-lucid' (universe)
 Command 'emacs' from package 'jove' (universe)
emacas: command not found
Ooops... 
myuser@MYCOMPUTER:emacs
The program 'emacs' can be found in the following packages:
 * emacs24
 * emacs24-nox
 * e3
 * emacs23
 * emacs23-lucid
 * emacs23-nox
 * emacs24-lucid
 * jove
Try: sudo apt-get install <selected package>
Being a smart alec, I curiously tried instead 
myuser@MYCOMPUTER:sudo apt-get install emacs
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  os-prober
Use 'apt-get autoremove' to remove it.
The following extra packages will be installed:
  acl at-spi2-core ...  x11-common
Suggested packages:
  emacs24-el ... fonts-unfonts-core
The following NEW packages will be installed:
  acl ...  x11-common
0 upgraded, 114 newly installed, 0 to remove and 0 not upgraded.
Need to get 47.6 MB of archives.
After this operation, 192 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main imagemagick-common all 8:6.7.7.10-6ubuntu3 [37.2 kB]
.... [ a long list ] ...
Get:68 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgtk-3-0 amd64 3.10.8-0ubuntu1.6 [1,960 kB]
Err http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgudev-1.0-0 amd64 1:204-5ubuntu20.18
  404  Not Found [IP: 91.189.88.161 80]
...
Get:113 http://archive.ubuntu.com/ubuntu/ trusty/main librsvg2-common amd64 2.40.2-1 [4,990 B]
Fetched 47.6 MB in 1min 33s (508 kB/s)
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/s/systemd/libgudev-1.0-0_204-5ubuntu20.18_amd64.deb  404  Not Found [IP: 91.189.88.161 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Ok, first, lets make sure we are on ground level. 
myuser@MYCOMPUTER:sudo apt-get update
Get:1 http://security.ubuntu.com trusty-security InRelease [65.9 kB]
Ign http://archive.ubuntu.com trusty InRelease
Get:2 http://archive.ubuntu.com trusty-updates InRelease [65.9 kB]
Get:3 http://security.ubuntu.com trusty-security/main amd64 Packages [462 kB]
Hit http://archive.ubuntu.com trusty Release.gpg
Get:4 http://archive.ubuntu.com trusty-updates/main amd64 Packages [758 kB]
Get:5 http://security.ubuntu.com trusty-security/restricted amd64 Packages [13.0 kB]
Get:6 http://security.ubuntu.com trusty-security/universe amd64 Packages [127 kB]
Get:7 http://security.ubuntu.com trusty-security/multiverse amd64 Packages [4,982 B]
Get:8 http://security.ubuntu.com trusty-security/main Translation-en [254 kB]
Get:9 http://security.ubuntu.com trusty-security/multiverse Translation-en [2,570 B]
Get:10 http://security.ubuntu.com trusty-security/restricted Translation-en [3,206 B]
Get:11 http://security.ubuntu.com trusty-security/universe Translation-en [75.1 kB]
Get:12 http://archive.ubuntu.com trusty-updates/restricted amd64 Packages [15.9 kB]
Get:13 http://archive.ubuntu.com trusty-updates/universe amd64 Packages [359 kB]
Get:14 http://archive.ubuntu.com trusty-updates/multiverse amd64 Packages [13.2 kB]
Get:15 http://archive.ubuntu.com trusty-updates/main Translation-en [380 kB]
Get:16 http://archive.ubuntu.com trusty-updates/multiverse Translation-en [7,227 B]
Get:17 http://archive.ubuntu.com trusty-updates/restricted Translation-en [3,699 B]
Get:18 http://archive.ubuntu.com trusty-updates/universe Translation-en [188 kB]
Hit http://archive.ubuntu.com trusty Release
Hit http://archive.ubuntu.com trusty/main amd64 Packages
Hit http://archive.ubuntu.com trusty/restricted amd64 Packages
Hit http://archive.ubuntu.com trusty/universe amd64 Packages
Hit http://archive.ubuntu.com trusty/multiverse amd64 Packages
Hit http://archive.ubuntu.com trusty/main Translation-en
Hit http://archive.ubuntu.com trusty/multiverse Translation-en
Hit http://archive.ubuntu.com trusty/restricted Translation-en
Hit http://archive.ubuntu.com trusty/universe Translation-en
Ign http://archive.ubuntu.com trusty/main Translation-en_US
Ign http://archive.ubuntu.com trusty/multiverse Translation-en_US
Ign http://archive.ubuntu.com trusty/restricted Translation-en_US
Ign http://archive.ubuntu.com trusty/universe Translation-en_US
Fetched 2,800 kB in 12s (216 kB/s)
Reading package lists... Done
Now, lets do it properly 
myuser@MYCOMPUTER:sudo apt-get install emacs24
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  os-prober
Use 'apt-get autoremove' to remove it.
The following extra packages will be installed:
  acl ...  x11-common
Suggested packages:
  emacs24-el ... fonts-unfonts-core
The following NEW packages will be installed:
  acl ...  x11-common
0 upgraded, 113 newly installed, 0 to remove and 22 not upgraded.
Need to get 145 kB/47.6 MB of archives.
After this operation, 192 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ trusty-updates/main liblcms2-2 amd64 2.5-0ubuntu4.1 [131 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ trusty-updates/main libgudev-1.0-0 amd64 1:204-5ubuntu20.19 [14.1 kB]
Fetched 145 kB in 0s (190 kB/s)
Extracting templates from packages: 100%
Preconfiguring packages ...
E: Can not write log (Is /dev/pts mounted?) - openpty (2: No such file or directory)
Selecting previously unselected package imagemagick-common.
(Reading database ... 24998 files and directories currently installed.)
Preparing to unpack ...
...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
....
Setting up libasound2-data (1.0.27.2-3ubuntu7) ...
...
Now, lets see how that went...
myuser@MYCOMPUTER:emacs
and .... its working ! 

(Too lazy to take a screen shot. How do you exit emacs? It always surprises me, that too frequently, people who know how to exit vi , don't know how to exit emacs  ) 

Now lets get a tad more serious.
ifconfig and top don't give us what we expect
(try it yourself; they are practically unfunctional)

Installing sqlite3  went smoothly, and although it was a small test, it worked just as usual. 

Python3 worked out of the box. 

I had to struggle a bit with cowsay, but the solution suggested here (the problem is not related to  running on windows. it is a general debian issue) solved the problem. 
Now, time for some heavier work. Let's see how some real shell scripts work. 
To make it fair, at first, we'll use relatively short and simple scripts, checking compatibility: 



It didn't work. I guess the problem is with the implementation of file system. If it shall remain this way, such scripts shall require conversion. 

A second attempt. A scraping script of sorts (more accurately, a skeleton script, used for other, more sophisticated ones), worked like a charm, as is.
This script used curl, sed, cut and tr, and a simple for loop. 

So, in summary, this bash on windows thing actually works, and it will make working with windows 10 more attractive. (and her predecessors, if there will be any)

Thinking about the impact of Bash on Ubuntu On Windows 
Microsoft claims that this should make open source work with Windows significantly easier. 

I personally think it is part of their recognition that linux (in the guise of android) has gained the upper hand in the end-less war of operating system dominance, and that Microsoft, realizing that she can't beat them, has finally joined them. Adding this to the latest 'steal' of Linux legend Wim Coekaerts' from Oracle (and  I checked, his linkedin states he really is a Redmond employee now. It wasn't an April Fool's joke either (-; !) 

What does it mean down the line? I believe that what interests Microsoft most right now, is probably out-of-the-box support for android apps, google-play support, and a great addition of openness into the rather small world of Windows. Without those, Windows shall die sooner than later. With those, Microsoft may find some interesting angle in which to make it a more attractive O/S than the other major alternatives manufacturers of the future may consider.

Microsoft may have lost the war of smart phones, but the war of the Internet of things is just beginning. Who is to say what operating system shall dominate cars ? refrigerators ? doors?

In the shorter term, this may be the first step in a wave that shall bring down the walls between other app stores, making consumer's life in the iOS/Android/Microsoft/specific-vendors ghetto spaces much simpler and richer.

But let's leave those guesses aside, and concentrate on the really immediate conclusion: the final mote of windows is down. Microsoft itself has brought Linux inside!

Let's play with bash on ubuntu on windows!

Bash on Ubuntu on Windows Start Menu






Wednesday, May 4, 2016

Howto download Windows 7 - from Microsoft !

With my 'love' for Windows 10 spread over this blog in recent months, it won't come as a great surprise for loyal readers that I was very glad to run into this MakeUseOf article, explaining how one can freely download various versions of Windows builds, including good old Windows 7 from the Microsoft Website!

For those who find this official path for installing the aging Windows 7 interesting, 3 pointers:
1) Pay attention that the article has a little error, and that the code they suggest interweaving into Microsoft's website (using the browser's console in a very simple manner) should be taken from another place - the original pastebin of the people who worked on this hack.
2) you need to really dislike Windows 10 to be willing to fight the drivers war that new hardware may require for Windows 7 to properly work.
3) Having the software build and using it legally are two completely different things. You will need to legally obtain a Windows 7 product key. For that purpose, check the following ZDNET article.
Don't want to use a key ? Then why use Windows at all ?

Other people who for some reason like Windows 10, may also be excited about this item. Why? Because this gives you access to many more builds of Windows 8 and Windows 10 from Microsoft's own website. They don't officially give you that option, but they can't be completely against a hack that is running around the web for about 6 months now. 

Want to know how many builds? check out the following combined droplist from Microsoft's techbench, as is displayed using the hack. If you inspect the scrollbar you can guess how many screen shots were used in the making of this combined droplist, and realize its length...

dropdown list of the windows o/s builds actually available to download from Microsoft's website
Windows editions that can actually be downloaded from Microsoft.com

update, 12/5/2020: 
I won't be a surprise to anyone to learn that as far as windows usage goes, like everyone else, I too succumbed to Windows 10. No longer needing windows 7 installations, meant I did not check this post for a long time. But a friend asking If I still had a Windows 7 installation cd around naturally revived the memory of this post, and the sad discovery that it no longer works. No worries, Windows7 fans - there is still a solution, as described in this newer post: Downloading windows 7 in modern times

Sunday, April 17, 2016

which would be faster on python?

I wanted to know which would be faster to find a small string within a LARGE one, regular expression or the find function (intuitively I assumed find would be faster, but the size of the Large string bothered me, and I wished to be on the sfe side). 

On the way ran into the more general question: how to check which is faster in python? 

The answer: the timeit module - a simple way to time small bits of Python code.
An example: 
import timeit
import re
string1="aaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaa"
string2="baaa"
print ('find='+str(timeit.timeit("string1.find(string2)",'string1="aaaaaaaaaaaabbbbbbbbbbbbbbbbaaaaaaaaaaaaaaaaa"; string2="baaa"')))
print('re='+str(timeit.timeit("re.match(string1, string2)","from __main__ import string1,string2,re")))
One has to admit that it isn't the most convenient method, but still - the answer on my machine, for a single run (which is better than none, but more times would be better), was: 

$ python3 testimeit.py
find=0.31890193399158306
re=0.8841714099980891

Further reading                        
  • a discussion in stackoverflow  
  • the docs: Worthwhile knowing that timeit can be used from the Command-Line Interface as well as in the callable form. Also worth checking the examples in the docs - timeit can be used in  more readable than this post may make one fear... 



Friday, April 1, 2016

Bash on Windows !?

It sounded like the best Microsoft windows news for a long time: The Verge reported that bash is coming to Windows. Yes, the bourne again shell becomes native on Redmond's turf. 

Hard to believe as it was, the news item was talking of bash itself, not another third-party alternative making Windows more friendly and useful for linux folk (and I mean no disrespect for the wonderful solutions out there, cygwin being my favorite here). 

Starting to check things out, I was glad to see that this exciting news piece was supported by a Microsoft news release confirming this new step for windows.

It was further detailed by a MSDN blog post. I've got to admit that reading that last blog post, things lost some of their initial buzz, and actually started to seem a little funny. some promises too vague, some premises downright strange.

But excitement made me miss the punch for a few more minutes of imaginative day-dreaming...

before I realized what day it is today....

Sunday, March 27, 2016

Sometimes, your best windows watch-dog, is a linux

I had an annoying morning with linux mint refusing to boot, 
in what at first appeared like a weird hanging at initial logo 
then, switching to the text messages (something you would expect
any self-respecting o/s to do, once an error is encountered),
it became apparent that mint was encountering difficulties 
mounting a partition. the data partition. 

Rebooting into mint recovery, and running fsck (thru the nice menu the recovery mode suggests)
things soon became clear: the data partition had a problem. 

Thinking about it, it soon became clear - During the weekend i found myself  booting using windows 10 (something i haven't done for a while, wishing to check something
about oracle xe on windows), and apparently, something in that usage end
left the partition with errors. 

Rebooting into windows, i expected the o/s to find the error and fix it by itself,
but windows 10 thought everything is ok(strengthening my dislike for this horrendous o/s). 

Only a manual chkdsk (using the nice properties/tools menu) has made windows realize that there was a problem with the partition. 

Having repaired it, I rebooted, and was happy to be back  with mint. But before I got back to work, I thought it might be wise to document this sordid adventure. 

So, what did I learn this morning ? 
1. linux is better than windows in identifying problems relating to an  NTFS partition both
   systems use in a dual-boot architecture.  
2. mint is not very good in communicating its problems at boot through the GUI interface. 
3. even a random usage of windows 10 may haunt you days later...

[update, 10/04/2016: I've been a little bothered by Mint's behavior and went back to find out why was it that I could not fix the partition's errors through Mint, turns out that ntfsfix is not linked by default to fsck.ntfs. Leaving fsck helpless, facing NTFS partitions. If you ran into a similar problem, this thread suggests a solution - making the necessary links - that worked for me]


Friday, March 4, 2016

installing android 4.4-r5 on virtual box and falling at grub?

I Tried installing android for pc 4.4-r5 on a virtual box virtual machine and was saddened by a weird phenomenon.  The installation seemed to go smooth, but at reboot, I was dropped to grub. 

Solution
When you are in the partitioning stage, create 2 (TWO) partitions:
a first, small one, for grub, 
a second, large one, for Android. 

Afterwards, everything will go smoothloy. 

useful links

Monday, February 29, 2016

installing python 3 on centos 6.7

installing python 3 on centos 6.7 
centos has this annoying aspect of being tied to older versions. but I wish to focus on python 3 these days, even while using an older centos, and without changing the system in a manner that may create unexpected result. what can i do ? 

1) install scl 
a) browse complete list of packages available from the SCL 
yum --disablerepo="*" --enablerepo="scl" list available

b) search only SCL packages
yum --disablerepo="*" --enablerepo="scl" search <keyword>

c) list of packages installed from the SCL
scl --list

2) install python 3
sudo yum --disablerepo="*" --enablerepo="scl" install python33       

3) run python 3
scl enable python33 bash


further reading



Installing Python

what do you need for beginnings? 
  • python
  • idle
  • pip
in mint17 (my current favorite o.s), the process was:
  1. sudo apt-get install python3 
  2. sudo apt-get install idle3
  3. sudo apt-get install python-pip
(on windows, go to python downloads, download & install. You Python, IDLE & pip are included;
run pip from PYTHON-HOME\scripts, which would mean on the average windows machine,
something like the folloing command -  c:\python34\scripts\pip)

remark:
this how-to guide describes python 3.4.

further reading - some interesting discussions

Wednesday, January 27, 2016

a failed ddl will commit on Oracle DB

Let us view a real-life recorded scenario

SQL> create table test2 (n1 number);
Table created.

SQL> insert into test2 values (1);
1 row created.

SQL> c/1/2
  1* insert into test2 values (2)

SQL> /
1 row created.

SQL> commit;
Commit complete.

SQL> insert into test2 values (3);
1 row created.

SQL> create view viewtest2 as select * from test2;
create view viewtest2 as select * from test2
            *
ERROR at line 1:
ORA-01031: insufficient privileges

SQL> rollback;
Rollback complete.

SQL> select * from test2;
        N1
----------
         1
         2
         3

SQL>


Why is that
lets take a look at the execution order of a DDL in Oracle,
"Typically, the database would run dozens of recursive statements to execute the preceding statement. The recursive SQL would perform actions such as the following:
  •  Issue a COMMIT before executing the CREATE TABLE statement
  •  Verify that user privileges are sufficient to create the table
  •  Determine which tablespace the table should reside in
  •  Ensure that the tablespace quota has not been exceeded
  •  Ensure that no object in the schema has the same name
  •  Insert rows that define the table into the data dictionary
  •  Issue a COMMIT if the DDL statement succeeded or a ROLLBACK if it did not" 
one could say that this is a necessity, 
but one could also claim that the first commit could have been executed at a later stage 
(after all the checks and just before writing into the data dictionary); 

if you wish to differentiate the commit from the regular flow, one way to workaround this, suggested by tom kyte, is to use an autonomous transaction. Another way is to use a savepoint. 



Related info: