Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Tuesday, October 01, 2013

Notes: How to add ssl certificate for chrome on linux

So I finally got tired of constantly having to hit 'proceed...' when I access web services at work since I know and trust the servers so I finally took the 5 minutes to google....

solution can be found in the following links:

The also includes notes for other platforms, but I at this time only care about the linux tip.

solution:
  1. click on the lock in the url bar and under the connection tab click the 'certificate information' link. 
  2. export certificate (I selected 'pkcs #7 single)
  3. ensure you have nss utils installed (deb: libnss3-tools; rpm: nss-tools)
  4. certutil -d sql:$HOME/.pki/nssdb -A -t "P,," -n <filepath> -i <filepath>
  5. restart chrome
and viola you are done.


Friday, April 26, 2013

Installing/Running Google Chrome from linux (rhel6) without Root

Update: so I gave up on the non-root and ended up using the following script provided at:
http://chrome.richardlloyd.org.uk/

So there are a number of articles posted on this topic and I don't mean to replace or usurp them, just post what worked for me for my future use. But first the link that I started with:
http://indiayouthtechtips.blogspot.com/2012/03/how-to-install-google-chrome-without.html

my steps:

  1. download latest chrome from google: https://www.google.com/intl/en/chrome/browser/?brand=CHMO#eula
    • for my purpose I selected the 64-bit rpm
  2. create install area:
    •  mkdir /some/path/for/chrome
  3. copy downloaded rpm to path setup above and cd into folder
  4. open rpm with cpio (the real task that makes things work):
    • rpm2cpio /path/to/download/google-chrome-stable_current_x86_64.rpm | cpio -id
  5. link the following file:
    • libbz2.so.1.0 -> /usr/lib64/libbz2.so
  6. run with following:
    • google-chrome --no-sandbox --always-authorize-plugins --allow-outdated-plugins %U
As you will notice if you review the above link to other directions, I basically skipped all the linking steps with the exception of libbz2.

I also made a launcher icon with gnome with the same command listed in step 6.

well that is what worked for me :-)

Sunday, April 14, 2013

cmdline find of the day: tee

I'm always amazed at how much of linux/unix I've never used. I've been working with unix and linux going on 17 years now and I've never used the command 'tee' but today while googling for a trick to trap the output of the command line to a file and pipe to the screen at the same time I came across it.

For years, I've been doing the following:
command >& log_name & tail -f log_name
or occasionally I substitute 'tail' with 'less' and press 'shift+f'... but today and for now on, I'm simply using tee:
command 2>&1 | tee log_name
Tee does just that, it captures stdout (and if you use 2>&1 stderr) and pipes to a file while printing to the screen.

and to make my life even easier.... the reason I was looking for this command was so that I could easily put together a simple bash function that would trap the output from 'make' add place it in a log file with a time stamp. Here is my simple function
MAKE()
{
   make $@ 2>&1 | tee ${!#}_`date +%Y%m%d%H%M`.log
}
 and if you are curious the '${!#}' part grabs the last argument on the command line so that if you want to use tools like '-j3' for multiple jobs or '-l3.9' to load management it won't get mixed into your log file name.

Thursday, June 17, 2010

Resurrected Posts: Playing with RPM

RPM (Redhat Package Manager) is the basic packaging for most all packages found for RHEL and its clones. .

list of basic command

to install package:
rpm -Uvh <package name> # note: package can be an ftp url
to erase package:
rpm -e <package name> # note: if there are 2 packages with the same name try placing either a ".i386" or a ".x86_64". This is usually the case and it occurs when both the 64bit and 32bit versions are both installed
to query the rpm database:
rpm -q <package name> # note this will only match exact package names
the better way:
rpm -qa | grep -i <package name> 
rebuild the rpm database:
rpmdb --rebuilddb
build from srpm (src rpm): # note: this is the quick and dirty method
rpm -ivh <package name>.src.rpm
cd /usr/src/.../SPECS
rpmbuild -bb <package name>.spec
cd /usr/src/.../RPMS
rpm -Uvh <package name>.ARCH.rpm
# note: this is the quicker and dirtier method
rpmbuild --rebuild <package name>.src.rpm

Tuesday, September 22, 2009

Stumbling into Tips: /etc/profile.d

Well I've been using Linux/UNIX a long time. I've been playing with cshrc, bashrc and profile files for a while to, but for the first time, today I stumbled across an interesting directory, the '/etc/profile.d' directory. Like all '.d' directories in the 'etc' directory this is a directory to put additional configuration files.

For sh-style shells (sh, bash...) /etc/profile.d/*.sh are read and run, for csh-style shells /etc/profile.d/*.csh are run. It's a great place and a clean way to easily plug settings (like $PATH) in and out for new programs you can't get RPMs for. In my case I did so to help setup my jboss installation.

Tuesday, April 07, 2009

Python2.6, Trac0.11.x, mod_wsgi and mod_python on RHEL5.x

New server and new problems.

Late last year my patched along circa 1999 Dell server decided to go belly up. That server was running Centos-5.2 and hosted my Trac installation running Trac-0.11b, running in Apache using mod_wsgi. So recently we finally replaced the server with a brand spanking new Dell server (heck if its predecessor lasted almost 10years, I hope this new one lasts at least 5years). I installed RHEL5.3 on this server instead of Centos since we (the IT group at work) want to simplify our OS variations and stick with the commercially available RedHat Enterprise Linux. And that is where my problems began.....

Well as we all know RHEL5.x still only includes Python2.4 with the distribution. Centos and other variant have started to include or at least are upgradable to Python2.5. While RHEL5 does include mod_python, mod_wsgi, Python2.4 and Trac0.10.x... I needed Trac0.11.x

Solution: drop RHEL and go with Centos... just kidding

So actually it turns out not to be that bad... you just have to do a lot of manual compliations... so here is my step by step solution:

Step 1. install Python from source, I went with the latest 2.6.1 (not 3 yet since on my Mac I've had backwards compitibility issues and didn't want to deal with them)

./configure --with-threads --enable-shared
make
make altinstall
ldconfig
the 2 key steps: --enable-shared in the configure statement does the work needed later by mod_wsgi and mod_python, and 'make altinstall'  which tells the installation to use /usr/local and to appended the 2.6 to the commands to prevent messing up system scripts which are based on Python 2.4 and in many cases (yum included) do not work with Pytohn2.6. The last step 'ldconfig' simply refreshes the library information which is needed before compiling mod_wsgi or mod_python from source.

optionally required step: if the shared library for Python is not seen in the '.../python2.6/config/' you'll need to add a symbolic link
ln -s ../../libpython2.5.so .
now on my server, the python config directory was at:  /usr/local/lib/python2.6/config


Step 2. install 'mod_wsgi' from source.

./configure --with-python=/usr/local/bin/python2.6
make
make install
here the only statement of difference is to tell mod_wsgi to use python2.6 instead of the system default 2.4, now if you have installation errors check out http://code.google.com/p/modwsgi/wiki/InstallationIssues this page also explains the optional step after the Python installation.


Step 3. install 'mod_python' from source.

./configure --with-python=/usr/local/bin/python2.6
make
make install
as you can see, there is no difference between the methods for compiling mod_python and mod_wsgi. And again the main reason for compiling from source is to enable the use of Python2.6. And since both of these modules will be using Python, this is the reason of compiling Python2.6 with the '--enable-shared' flag.
    Step 4. download and install the python setuptools for python 2.6 using the py26.egg.


    Step 5.  using easy_install tool from the setuptools in Step 4, install Trac.
    easy_install-2.6 trac
    this will automatically install Trac.11.x since it is the latest version compatible with Python2.6, and using 'easy_install-2.6' will ensure that you are using Python 2.6

    Step 6. configure Apache like instructed by TracModWSGI.

    Now that wasn't to painful, the only clevat... now since all these packages have been installed from source, for security purposes, you have to remember on your own to update/patch these installs.

    update: I've run into a slight problem where Trac can't access SVN since the libraries aren't 'accessible' by Python2.6, I'l update again when this is solved

    update2:  Solution to get the SVN-SWIG installation to work with Python2.6... recompile subversion, only 'change' needed was manually hard coding the version of Python in the './configure' file
    # Python: Used for testsuite, and bindings

    #PYTHON="`$abs_srcdir/build/find_python.sh`"
    PYTHON="/usr/local/bin/python2.6"
     Only remaining issue was where the files were installed to. Presumingly there is another line in the ./configure file to correct this, but I went the 'quick' way... symbolic links.
    cd /usr/local/lib/python2.6
    ln -s /usr/local/lib/svn-python/* .

    Monday, February 23, 2009

    Accessing a Juniper SSL-VPN via Ubuntu Intrepid (Easy Peasy on my EeePC)

    Well I've spent the last two days hacking and whacking trying to figure out how to access my offices Juniper VPN via my EeePC which I've replaced the OS with Easy Peasy (Ubuntu). Well it turns out that the problem relates to two things.... 1. Juniper wrote their "Network Connect" applications under the assumption that RedHat (RPM) is the only version of Linux in the world, and 2. the web security settings on Intrepid in some cases are higher than that of Windows......(okay not that bad).

    Well while their are many 'solutions' to get Network Connect to work on Ubuntu... I couldn't manage to get any of them two work... what bothers me is that I had no problem on my desktop (now dead) with Ubuntu 8.04... but 8.10 (Intrepid) its a no go for me. Besides that since my office prefers that we use the JSAM application rather than the Network Connect app. So the problem there.... well.... the applet (yes JSAM is a java applet) requires root access to run. On Windows and on my Mac, this is no problem, the OS simply pops up a message box asking for an administrative password, but on Intrepid, from looking at the logs, it looks like Intrepid just kills the applet. solution... run firefox as root... well that turned out to be another surprising issue. You can set the password to root all you want... you can 'su -' or even login as root... so how do you run as root.... 99% of the time, you type 'sudo ', but while it starts an applications with root access... surprisingly, running anything inside that app does not necessarily have the same access. Solution:
    sudo su
    this will actually give you a terminal shell (of course you have to run it from the terminal) in which you can launch Firefox with complete root access... with this access, you can easily run the JSAM applet (assuming you have the Java plugin installed)

    update: you can also do this same feature using
    gksu firefox http://vpn_url &
     I think I'll be adding a simple desktop shortcut or cli alias for this....

    update 2: using 'gksu' even lets the "Network Connect" app work  (assuming you've followed one of the many posts on the web about making it work with Ubuntu).... damn security crap.

    Friday, March 21, 2008

    Whether or not to upgrade to a beta

    The next release of Ubuntu (Hardy Heron) is scheduled for release April 24th, but if you are really daring, you can upgrade from either 6.06 LTS or 7.10 straight to the beta version now out. Now here is the dilemma... I scanned the new features, and yes they look good, but here is the issue, I've got an older-ish system with a new-ish NVidia card (not a top notch state of the art card but much newer that the system as a whole) powering my widescreen LCD monitor. Every time there is any kind of change to the kernel, I run into issues. I know that I've got to recompile the kernel with the NVidia drivers and all, but it doesn't always work... quite often I just try not to reboot in fear that the update will krap out. anyways... but I also like living and playing on the edge with tech... so my instinct is to say screw it and go for it with the upgrade... but today is my birthday and it would really suck if I killed my system today... so maybe tomorrow....

    HardyUpgrades - Community Ubuntu Documentation

    If you are curious enough to try out the latest beta and via the upgrade, let me know how it all goes....

    Friday, February 08, 2008

    Alternative to Cygwin for Unix on Windows

    I used Cygwin up until the point I made the full move to linux, but I always recommend Cygwin to those who need Unix in their windows. Here is an alternative that looks to be shall we say 'lighter'. UnixUtils seems to be a set of window binaries for most/many Unix commands with out the Unix Cygwin layer. They work straight in your regular Cmd. Basically Unix without BASH. So if you need this kind of solution... I guess give it a try... I'll stick with my Linux System (Ubuntu is what I'm currently running).

    read more | digg story

    Monday, January 28, 2008

    Nokia acquires Trolltech, goes cross-platform

    I wonder what this will mean for the mobile market and for Symbian. I also wonder what are the real plans for the TrollTech product line. TrollTech is the maker of Qtopia but also QT the cross platform windowing package, which until recently KDE was based on. I can see where this move works with the linux tablets, but Qtopia is also linux-based and meant for phones.... do you think Nokia has plans on merging the two? or shifting away from Sybian, or do you think they may just do what they've done with every other mobile app company they bought... maintain for a year or two and then shutdown.... They did it with IntelliSync and a few others?

    read more | digg story

    Friday, March 02, 2007

    Songbird update

    Previously I posted on the subject of installing Songbird on Ubuntu. Today, Songbird 0.2.5 was announced. I figured I'd need to go and once again run the script to install everything, probably some un-install and then some re-install process. To my surprise when I downloaded and ran the latest version of the install script, it actually stopped in its tracks and said that since I had already installed Songbird, I could use the built-in update feature. How nice of the script to check for me.

    Also a note about the new version, it looks to have better iPod support and it included a new add-on for the Hype Machine, I don't know how it will work but I've been going to the Hype Machine for sometime now for new music.

    Wednesday, February 28, 2007

    SSH and Permissions

    I just spent the better part of the last 2 days working on setting up SSH with private/public shared keys. I've done this many a times so I launched my nifty file containing the documentation I've used in the past and went to work. I first made my key pairs on both machines, and then I transfered the file to there respective sides. The connection for hostA to hostB worked flawlessly from the first instance, now hostB to hostA was another story. Of course the first thing I did was check the permissions:

    hostA:> chmod 700 ~user1/.ssh
    hostA:> chmod 600 ~user1/.ssh/*

    and tried again... still did not work. Next I checked the /etc/ssh/sshd_config , everything looked fine and actually when diff'd with the one on the other server, they were identical. I should mention that hostB is a Redhat ES 4.4 server and hostA is Centos 4.4 server (basically identical). Well I scratched my head and went to google. Of course every forum and mailing list result I found said: "check the permissions". Well I did it again..... and again... and again.... still no luck. This is when I decided to try a different user.
    hostA:> chmod 700 ~user2/.ssh
    hostA:> chmod 600 ~user2/.ssh/*
    And guess what.... it worked. this is when it hit me. the actuall directory structure. The typical hierarchy looks like this:
    owner path
    root /home
    user1 /home/user1
    user2 /home/user2

    but this was my hierarchy:
    owner path
    root /home
    user2 /home/user2
    user1 /home/user2/user1

    All I can figure is that since the parent to the users home was not owned by root, SSH didn't work. Solution:

    owner path
    root /home
    user2 /home/user2
    user1 /home/user1

    ln -s /home/user1 home/user2/user1

    Argh.... 2 days wasted and while I swore it was not permissions, it was just under the name "ownership". All because for layout reasons I want the home directory of one user with in the other.

    Monday, February 19, 2007

    Songbird on Ubuntu


    Well for a while now I've wanted to try Songbird on my linux box. I gave it a quick try when it first came out on my mac at work, but being a mac, nothing competes with iTunes. By far I've yet to see a music player that I like better than iTunes, but being a linux user at home, well no iTunes for me. Yes I know may people have managed to install iTunes for Windows via Wine, but the point of using linux, is that I don't want to use windows. Now I will admit, I do have wine installed and I've actually resorted to a few windows apps in the past, but I try very hard not to.

    Well anyways... like any good gnome distribution, Ubuntu includes Rhythmbox as it's default music player coupled with GStreamer. I have nothing against Rhythmbox, it just doesn't do it all for me. Recently I've been enjoying the interface of Listen (link). It has a very clean interface, similar to that Rhythmbox, and it too includes a nice dock/tray functionality allowing me to preserve every inch of real estate on my screen. It is a little buggy and and 0.5 was just released last week (I have not tried the release version just yet), and overall in my opinion a better player when it comes to look and feel than Rhythmbox.

    However back to the start of this entry, I've always wanted to give Songbird a try. I am a very happy user of all Mozilla creations. I'm an Firefox only browser, and if it isn't web mail, it has to be Thunderbird in my book. Mozilla has provided an excellent based for working off of. I've given Flock a swing, and enjoyed using Nvu when playing with web design, both excellent spin-offs of the Mozilla code base. And again back to Songbird... I guess I became a distant fan the minute I heard was was coming into existence. I wasn't to happy when I saw that is was only initially going to be available for Windows, but I was patient. Knowing that basically all of the Mozilla apps and spin-offs have always progressed this way, I felt it was worth waiting and keeping an I on it. Anyways, I did just that I watched and waited, as soon as I saw there was a Mac developer on the team, I waited for that version, and as soon as I saw they finally had Linux on the list... Well anyways, I quickly downloaded the first linux release as soon as it pop on the site. Unfortunately for me, I like all my apps to be nicely integrated with the Desktop, and while yes I know, I can easily add all the various gnome anchors and confs, I'm lazy. I've really enjoyed my last few years as a USER not a tinker. Anyways, being that it is presidents day, I'm at home! no access to iTunes, so I decided to give Songbird another quick whack. Being that this is the first attempt I've made at Songbird since moving to Ubuntu (was a long time Redhat/clone user), I first checked for a debian package, no luck. Than I decided to do a quick google search for write-ups and howto's for installing Songbird with Gnome and Ubuntu. To my enjoyment, I stumbled upon the following link:
    Installing Songbird on Ubuntu
    Here you will find 2 simple scripts, one for installing and one for un-installing. Well, like any good IT person who spends much time dealing with security issues, the first thing I did was read through the script looking for anything suspicious, finding none, I ran it. It works great, it asked a few quick questions to decide which version to download, and then for my password for sudo, and upon completion, in my Application menu I found a nice little Egg. Well part one complete, it is installed, now for usage.

    So far so good. Upon the first load, it asked where all my music is located, and read in my entire library. The primary thing I use audio players for is streaming music. With all the other players I've tried, you have to search the web, find the playlist or stream uri, and then go through the process of adding a radio station, the nice part about Songbird is that it is a partial web browser. I just type the search query or surf the web and find links to playlist. I personally am a fan of Shoutcast and it is an included extension with Songbird, and I also like DI.fm, SKY.fm and Somafm.com , all have a nice selection of stations, most can actually be found in the Shoutcast directory. Anyways... I just browsed over to the various sites I wanted to add, right-clicked, and was provided with a "Add as Playlist" option and poof, there is a new playlist of that stream.

    So far, I am happy, later this week, I'll start working with Podcasts!

    Sunday, January 07, 2007

    Ubuntu + Box.net = Happy Nick

    +
    Well one of the things that I could never seem to get working with Centos was the mounting of a webdav filesystem via davfs. Well today with the help of Ubuntu and the web, I've gotten it figure

    # apt-get install davfs2
    # mkdir /media/box.net
    # mount -t davfs http://www.box.net/dav /media/box.net


    I was also able to get the mount to work as me by adding a .davfs directory for me with the username and password, plus with an fstab entry. Of course you also have to setuid the mount.davfs for root.

    // setuid
    chmod 4555 executable_file
    // setgid
    chmod 2555 executable_file


    But now that that is all working, I can actively use my box.net account as part of my filesystem.
    I'm happy.

    references:
    [howto] Mount your Box.Net account using WebDAV via ubuntuforums
    How to set the setuid and setgid bit for files in Unix

    Ubuntu continued

    Well... like I said in my previous post, I moved to Ubuntu. I then promptly screwed my system up, and then I started over and got things working. Well the next step was to load all the standard apps that I use (basically Java stuff). I was easily able to load java, but I was never able to get Eclipse running.... well after many a tries and many a googling, I said screw it.... I remembered having a similar problem with the 64bit version of Eclipse and java on my Centos setup and that I had ended up installing the 32bit version. Of course I first spent many an hours trying to do this same thing, but in the long run, I gave up... now I'm running the 32-bit version of Ubuntu on my AMD 64bit processor... I know it is kind of a waste, but for now I will have to settle. Hopefully now that both the Intel Core 2 Duo and the AMD chips are all now 64bit the OSs will shortly follow... at that point, I'll give the 64bit version of Ubuntu another try. But for now I'm happy, my system works and the move to Ubuntu seems to be worth it overall.

    Friday, January 05, 2007

    Moved to Ubuntu


    Well after playing with the downloadable live cd from Ubuntu last night, I decided that I would make the move permanent. I've been a long time user of Redhat starting back with version 2.0 which I installed on a 386 back in 1996. I gave linux up for many years sticking only with MacOSX via my office computer, but when it came time to buy a home PC I knew that there was no way I was going to load windows. Being that while I love Macs, I refuse to pay the price tag. So I once again looked back to Linux. I first gave BSD a try since it is the back bone of MacOSX, but while I was able to quickly get it running, getting app was a pain especially when it came to java... From there I went to Mandrake but when they merged with Connectiva and ditched the Redhat kernel, I decided to go back to Redhat. Of course this was along the same time that Redhat formed Fedora and I did not wish to go that route or pay for RHEL. Well some at the NWS pointed me at the RHEL clone: ScientificLinux. That worked out well for several months until I got tired of waiting for updates. From there I went to the more popular Centos. Centos was nice and had an extremely similar look and feel to that of the actual RHEL (which I have on several work related machines. This to served me very well, until I finally purchased a LCD monitor (Viewsonic VX2035wm). Being a widescreen monitor, I unfortunately discovered that I was going to be a lot of work to get the resolution right. In steps Ubuntu. I was searching for a solution to my widescreen problem when I ran across several forum entries where people mentioned that they had no problems with widescreens and Ubuntu linux. So I clicked over to Ubuntu.com and started to dig around. Nicely enough, they had a downloadable Live/Install CD. Well naturally I quickly downloaded it for the AMD64 bit processor (then the x386 and then the PPC). I also started to remember a number of article about Google and Ubuntu.... so I went home and boot up the CD. To my great surprise everything worked great. My monitor looked great and all my accessories looked fine. So I started the installer. I must say that installing from a Live Linux CD has its advantages.... instant access to the internet while things load... if you have questions you can google them from the same machine that you are installing Ubuntu on. Anyways... to make this long story short, I've got my machine back up and running with Ubuntu and it looks great... of course I promptly killed it by not carefully restoring my files and consequently I over rose something... oh well time to start the process over again.