Sunday, February 5, 2017

Interesting Dialogue

1- I've read the Aeneid Mr. Thurman: "Do not trust the horse Trojans. I fear the Greeks even when they bring gifts". The Crown (S1, E4).

2- Is she making life difficult for you and peter?
yes, she wants to delay the engagement
Well it serves you right quite frankly, you both seem far too happy and far too in love.

3- "... I predict you'll spill the beverage over the saintly pair's feet, and be hauled off ..."
"I see it turning out quite differently" (Joseph and his brothers P 695

4- "How did your past become your present" (Joseph and his brothers P 728

5- Threw himself into it, with missionary intensity
https://www.youtube.com/watch?v=VymRHoSiWWU


Tuesday, August 2, 2016

Life Hacks

1- Few downsides for buying a new car:

  • the car loses it's value fast
  • you pay for still unproven and technology that is not tested enough, give others 10 years to be the cars test drivers. 
2- COSTCO:
  • Costco is known for it's credit card that gives you 2% back on all purchases in store. You can beat that by getting Chase Freedom CC, which gives you 5% money back every few quarters for COSTCO and similar stores. Also, DISCOVER, while not acceptable at the counter, gives you the same discount at COSTCO's website. So you can buy COSTCO prepaid cards that get mailed to your address and you get your 5% money back.  
  • Costco sends a mailer about items that WILL be sold at a discount in 2 weeks. Some of these items have a limit on how many you can purchase. You can game that system by buying these items withing 2 weeks before the discount kicks in. Then you show up with your receipt and you will get a refund for the discount if the purchase was within 2 week. However, these items don't count towards the limit of that discounted item
3- Bonds
  •  In the US. Banks give you a very low interest rate in checking accounts. I will list numbers of 2020 Jan
    • Checking accounts (around .01%).
    •  A better place to save your cash is to open a savings account online. Discover, for instance gives you around 1.7% these days. While this is way better than a checking accounts (or a savings account in a brick and morter bank) you can still do better
    • Treasury bonds, Series I pays 2.2%! These are considered the next safest thing after cash. You buy a 30 year loan from the government at a fixed rate + inflation adjustment. In fact, you pay no fed taxes on the earnings. And they can be purchased online, for no fee. The money compound tax free until you withdraw it, or if you designated to for college education for your kids they are Tax free! There is a 10k limit, per person, per tax year. see Treasuredirect.gov

Saturday, March 5, 2016

Error with apt-get

Recently I tried to update ubuntu software and I got the following error:

dpkg: error processing install-info (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 install-info
I think it had to do with a resent MySQL update I made. Any way, the only solution that worked for
me was:
sudo mv /var/lib/dpkg/info/install-info.postinst /var/lib/dpkg/info/install-info.postinst.bad
which seems a bit drastic. Oh well, it can be reversed: 
 sudo mv /var/lib/dpkg/info/install-info.postinst.bad /var/lib/dpkg/info/install-info.postinst
 reference: http://ubuntuforums.org/showthread.php?t=1578263 
and update: Similar problem occurred to me when I updated to Ubuntu 16.04. 
/usr/sbin/update-info-dir: 2: /etc/environment: source: not found
dpkg: error processing package install-info (--configure):
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
 install-info
 
This time I opened the etc/environment file, and by trial I commented the second line
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/mysql/server-5.6/bin"
#source /etc/environment  
It worked! 
 

Thursday, December 24, 2015

Fixing wifi at my Dell Inspiron E1505

This is a common issue among Linux users. Every time you make a fresh install there is big chance that your Wifi will not work. This was the case for me when I removed the partitioning and decided to go all UBUNTU. The fix was reasonable (after finding the right solution of course)

first step, know exactly what is your Wifi drive:

$lspci -v
Network controller [0280]: Broadcom Corporation BCM4311 802.11b/g WLAN [14e4:4311] (rev 01)
    Subsystem: Dell Wireless 1390 WLAN Mini-Card [1028:0007]
    Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR-     Latency: 0, Cache Line Size: 64 bytes
    Interrupt: pin A routed to IRQ 16
    Region 0: Memory at efdfc000 (32-bit, non-prefetchable) [size=16K]


so my drive is The infamous Broadcom BC4. Now I need to install it

$sudo apt-get install firmware-b43-installer b43-fwcutter

then a reboot is in order (it is better to disconnect the Ethernet while doing this step)

now try turning it on
$sudo modprobe b43

Tada! Know it can see the signal and life is good.

http://askubuntu.com/questions/271044/getting-wireless-to-work-dell-inspiron-e1505-bcm4311

Tuesday, February 24, 2015

Touch pad wasin't responding for Dell Inspiron 17 - 7547

When instiall Ubuntu 12.04 on Dell 15 Inspiron machine, the fancy touch pad wasn't working. After some research the suggested fix was to update the kernel:

the current Kernel was:

$uname -r

3.13.1


To update to a newer Kernel (I read that 3.17 or 3.18 solved this problem) we do the following (64-Bit):

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18.1-vivid/linux-headers-3.18.1-031801_3.18.1-031801.201412170637_all.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18.1-vivid/linux-headers-3.18.1-031801-generic_3.18.1-031801.201412170637_amd64.deb

$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18.1-vivid/linux-image-3.18.1-031801-generic_3.18.1-031801.201412170637_amd64.deb

$ sudo dpkg -i linux-headers-3.18.1*.deb linux-image-3.18.1*.deb  ## to install the Kernel

$ sudo update-grub   ## to update grup to fetch the new Kernel
$ sudo reboot

It worked like magic. How ever, the "right click" is still an issue, you can over come it by the double touch (two fingers at the same time). This gie the same effect as a right click. 




Source: http://www.linuxandubuntu.com/home/how-to-install-upgrade-linux-kernel-3181-in-ubuntu

Reloading voice credentials for UBUNTU

 
Sometimes, after long hourse of usage, I lose the voice in my laptop. Here is a nice fix. 
 
$pulseaudio -k && sudo alsa force-reload

Tuesday, February 17, 2015

Mergin /home and / in UBUNTU

After install ubuntu on the DELL machine (see last post). I noticed that the home drive was limited to only 8GB, while the root (/) directory had over 400GB size. The solution was to merge them both.

I followed this link (the section after the partitioning is the relevant one).

https://help.ubuntu.com/community/Partitioning/Home/Moving


Friday, January 30, 2015

Add UBUNTU 14.04 to windows 8.1 on DELL 7547

Good resource to consider:

http://www.everydaylinuxuser.com/2014/05/install-ubuntu-1404-alongside-windows.html

My problem with it was the requirement to remove secure boot. Indeed this is not necessary these days and could actually cause trouble in the partitioning phase.

 http://askubuntu.com/questions/458947/should-i-create-the-reserved-bios-boot-area-partition


http://askubuntu.com/questions/223177/how-much-space-i-should-use-for-ubuntu-which-partitions

Friday, July 4, 2014

Dells Inspiron 3000 vs an older Inspiron (E1505)

I bought my self a new Dell machine: Dell Inspiron 15, 3000 series. It has a Celeron N2830 processor, 4GB memory, 500 GB hard drive. My old Inspiron E1505 has been in service since 2007, It was a solid machine but with many issues to report:
1- The battery died quite early, and I never felt like spending over 100 dollars to get a new one that might fail as fast.
2- Less than one year into service, it became excruciatingly slow. I even doubled the RAM to 2GB without any avail. It took Windows VISTA over 10 minutes to start! Eventually, I ended up partitioning my 80GB hard drive and using Ubuntu for the next few years, which was more suitable for the machine performance and my line of work/studies. And from there, it was a steep learning curve on how to install and use skype! update the flash for youtube, and then going back to the older version. And ditching MS Office for open source alternatives such as OfficeLibre.All of these were fine replacements to the first order. However, I never viewed my old Inspiron E 1505 as more than a working machine.

The new machine is smaller in dimensions; the new one is almost one inch shorter. It is also   about half an inch thinner than the its older brother. The material seems solid and it is a bit lighter than its counter part. There are few issues with the design:
1- No lights! No Numlk, Wifi, bluetooth, capslk, power on, battery warning, nor that light that flicks like crazy when your machine is busy. These shortcuts might be reasonable for some of there light, but it seems a bit odd and not justified for others. There is no reason to know if your machine is running for instance if the GUI froze for a minute. There is only one light at the front left edge that indicates that the battery is charging.
2- The touch pad lacks the fast scrolling sides. Which were a nice addition to the older machine. Also the physical left and right bottons are a bit hard and noisy compared to the old style.
3- No ethernet port! Simple as that! if you have slow Wifi connection at home or at your office, tough luck, you will be stuck with it unless you will shell off few dollars for a convertor. There is an SD card slot, hidden in a nice place right below the touch pad. and there are only two USB ports on the left. There is an HDMI port on the left also. Also you will have to live without a DVD reader at this machine, which is fair enough since I use one once a year or so, if not less. This is a huge reduction from the E1505 model. Where it had 4 USB ports, ethernet port, 3 types of ports for projectors, and a nice system to read SD cards.
4- The webcam seems to be decent. The fact that it is on the default model shows how times has changed since I bought my first Dell. 

All this might fade when comparing the huge advantage in processing power, and storage for the new machine at the pittance of $250 (my old machine cost me around $700 7 years ago) . Not to mention getting rid of Windows Vista. starting up the machine you soon realize that windows 8.1 and this laptop are designed to be a cell phone rather than a laptop. Apps, Windows account that you have to have to run anything (different than your dell account and you are encouraged to use it instead...). The machine runs smoothly, but this is totally a new culture and environment for me. and it feels much more intimidating than what google is doing with it's own line of products.

Installing new software was painless and straight forward, the machine had only the option to try office 365 for free for a short time (No thank you). OfficeLibre impress is slow even on this 64bit machine! And skype is buggy and nothing close to the smooth experience you expect from windows (also you need to sign in and with your windows account and merge the other account with it!).


The 10hr battery seems to be working fine (so far). And all an all, after some big house cleaning of unused apps and apps that belong to your tablet or smartphone, this laptop should be ok. There are few shortcomings that Dell could have delt without, not substantial, but enough to make me think of partitioning this machine and install Ubuntu. At least next time I plan on buying a new machine, I have this blog entry to make me more informed. 

Tuesday, December 3, 2013

What to pack when flying

1- Lotion for your skin and your lips. Plane AC is hard on my type of skin, add to that the physical stress associated with flying. You might need to add dandruff shampoo if needed.
2- An empty bottle of water. Make sure to have it among your personal items (and that it is empty to pass TSA). Though flying food and beverages are filled with salt and caffeine, it is hard to get enough water due to the serving size in planes (also you need to keep asking for it) and all the airport fountains that hardly give you a chance to drink more than few sips.
3- Inflatable pillow. This helps if you have sleeping problems on the plain. It can also be very handy if you need to spend the night in an airport due to some emergency. 

Friday, March 1, 2013

X11 not working with UBUNTU

As it happens I ended up deleting my /tmp file. after a reboot the machine failed to get to the graphical display (x11). After some research here is what fixed it:

(move to a shell by ctr+alt+F1 or F2 or ... F6)

sudo dpkg-reconfigure xserver-xorg

if that doesn't work you can try something a bit more drastic

sudo apt-get install -- reinstall xserver-xorg

once you get that done try starting the graphic mode:
startx


this made the cursor visible and the wallpaper. But nothing else. The solution was

sudo service gdm restart

This will get you to the password page. You might be surprised that the machine didn't recognize my passport, until you know that /tmp is the place these things are communicated to the system and it has to be writable by everyone:

chmod 777 /tmp

once that is fixed  you should try startx the previous sudo serve command it will work.



Thursday, August 30, 2012

Reducing CPU frequency in UBUNTU

Seems that when installing UBUNTU in some machines. The setting for the CPU will be set for maximum performance. This tends to overheat the machine. One fix for this:

$ sudo [gvim or any text editor] /etc/rc.local

This will open the file and accept modifications to it:

#############################################
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will “exit 0″ on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
for cpu in /sys/devices/system/cpu/cpu?/cpufreq/scaling_governor; do
echo -n powersave > $ cpu
done

exit 0

#############################################

Add the 3 shaded lines and then reboot.

Friday, August 17, 2012

How to avoid typing a password for the default keyring for wireless after booting Ubuntu every time

After booting an Ubuntu machine, you are asked to unlock the default keyring for some wireless connection, the simple solution to avoid this:

1. Edit the wireless connection (Right-click the "Network Manager" icon on the panel at the top-right corner of the screen and click "Edit Connections.", Click the "Wireless" tab at the top of the Network Connections window, Select the wireless connection by clicking its name in the list, Click the "Edit" button)
2. Click the "Available To All Users" checkbox at the bottom of the connection window.

Unfortunately I didn't find an equally effective solution using the shell commpand prompt. 

(This recipe was found in this web-page: http://thanhsiang.org/faqing/node/117#comment-797) 

Friday, July 20, 2012

Fix X11 Freeze

Sometimes it happens that my UBUNTU Box freezes. Especially after extensive usage of the media. Here are two methods to handle this issue:

1- Going to a different virtual console.

Alt+Ctr+F1 (or F2, .... , F6)

After logging, you can restart the X server using:
$sudo service lightdm restart




P.S: This assumes that your display manager is lightdm (True for ubuntu 12.04). You can check your agent using /etc/X11/default-display-manager


2- If you cannot change to another virtual console, b/c the X server took control of the keyboard. You can try taking the control away from the X server using Sysrq.

Alt+SysRq+r

then try Ctr+Alt+F1.  You can also try Alt+SysRq+k, which kills all programs on the current console.

Finding The Display Manager in UBUNTU

Ubuntu has many display managers. In order to see which one is currently used check the file:

/etc/X11/default-display-manager

Sunday, May 27, 2012

ROOT to skip few columns with TGraph

I often use TGraph and TGraphErrors to make plots from text files with columns of data. Example below:

////////////////////////////////////
TGraphErrors *ProfNch09ATLAS = new TGraphErrors("Data/Profile_Nch_pT_09TeV_Data_ATLAS.dat", "%lg %lg %lg");
/////////////////////////////////

Which reads from the .dat file that has 3 columns of data. the x-value, the y-value, and the error in y-valye. If you need to add a 4th columns, the error in the x-value or the bin size, you can add it to be the 3rd column in your text file and the next file can be read using:

/////////////////////////////////
TGraphErrors("Data/Profile_Nch_pT_09TeV_Data_ATLAS.dat", "%lg %lg %lg %lg");
////////////////////////////////

but what id you had another plot that needs the original file? that is plotting on the the first two columns alongside the fourth. This time you can use the option *

///////////////////////////////
 TGraphErrors("Data/Profile_Nch_pT_09TeV_Data_ATLAS.dat", "%lg %lg %*lg %lg");
///////////////////////////////

For files with a dilemeter different than '/t' and ' ' the 'option' argument need to be used. see http://root.cern.ch/root/html/TGraph.html

Wednesday, February 1, 2012

ROOT to perform a shell command in a macro

You can make a ROOT macro execute another root macro or a shell command using the following line:

gROOT->ProcessLine("!shell_command");
or
gROOT->ProcessLine("ThisRootMacro()");

Don't forget that the macro needs to be uploaded first:
gROOT->LoadMaco(ThisRootMacro.C);

Tuesday, January 10, 2012

Running two separate verions of firefox on linux

In many cases of active web and software usage you might need to run an older version of a web browser. In this case I needed a to run Firefox 8 and I didn't want to remove my current version. here is what to do:

1- Create a separate directory and move to it:
$ mkdir /home/mzakaria/opt/firefox8
$ cd ~/opt/firefox8/

2- go to Mozilla FTP server at ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/. and look up the release you want

3- get the folder using wget:
$ wget ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/8.0/linux-i686/en-US/firefox-8.0.tar.bz2 (I got the one with i686 b/c I am using a 32bit machine, you can check that with the command uname -m; it will give you i686 if it was a 32bit)

4- untar the package:
$ tar xvjf firefox-8.0.tar.bz2

5-  move the unpacked folder to a folder with the name you chose (in case you are bringing more than one release)
$ mv firefox firefox8

6- Each version needs a separate user profile — otherwise, it won’t be possible to run them simultaneously, and worse, it might break the default profile which is used by the system version. For our version:
$ firefox -no-remote -CreateProfile firefox8

7- That's it! change to the folder again and run it:
$ cd firefox8/
$ ./firefox -no-remote -P firefox8

Notice that this will create a completely separate browser, you might want to move some bookmarks or certificates.


Friday, December 2, 2011

How to record a live stream

I found a lovely post on how to record a live stream or to record whatever audio is:

I'm using the Sound Recorder application that comes in standard Ubuntu installations. To set this up using other programs (like audacity) just substitute it in these instructions.

  1. Install pavucontrol (PulseAudio Volume Control) using apt-get or the Ubuntu Software Center.
  2. Open PulseAudio Volume Control. It should be in the applications menu under Sound and Video.
  3. Open Sound Recorder and start recording. Playing any sound at this point would be helpful, as your level indicator should react once you have finished.
  4. Go to the "Recording" tab in the PulseAudio Volume Control window.
  5. Make sure that "Applications" is selected in the drop down menu on the "Recording" tab.
  6. Choose "Monitor of Internal Audio Analog Atereo" from the "Record Stream from" menu in the Sound Recorder entry of the application list.

This appears to be persistent so that you will only have to do this once, but you will have to repeat these steps to record in another application.

After this I notice that my mice is disconnected from skype. Consider this as a fix:Open “Sound Preferences” -> “Hardware” -> “Change Profile to Analog Stereo Input” -> test -> “Change Profile to Analog Stereo Duplex” -> test again.

Saturday, July 30, 2011

Updating Firefox on Ubuntu

I can't find a solid reason to update my browser (unless some site or software that I use asks me to). Today I got tempted by a message on my gmail account asking me to do that. So here is how to do it:

sudo add-apt-repository ppa:mozillateam/firefox-stable
sudo apt-get update
sudo apt-get upgrade
 

This was method 2 among 3 ways to do it that I found under this post.

One new feature Firefox5 has is the Sync feature. So now you can have all your tabs and browsing needs saved (safely as I hope) and you can access then from any machine.