Archive for linux

[tekwalk] xopen : shell function to have verbose xdg-open : Mac’s “open” alternative for Linux

Posted in AbhishekKr, Blogroll, install-on-linux with tags , , , , , , , on March 4, 2014 by abhishekkr

tekwalk.blogspot.in [13/Feb/2014]

http://tekwalk.blogspot.in/2014/02/xopen-shell-function-to-have-verbose.html

I have been using xdg-open for sometime now, it’s a utility similar to “open” utility popular among MacOSx users.

It enables you to open any file in the default “open with” program assigned to it’s type. So, just passing any type of file to this utility would let you open it in the program it’s supposed to open.

What is xdg-open?
source[1]: https://wiki.archlinux.org/index.php/xdg-open
source[2]: http://linux.die.net/man/1/xdg-open

There is just this little shell function, that makes your xdg-open usage a bit more verbose in case of errors (bad-syntax/ghost-file/ghost-program/open-failure) faced about the reason for it. And also shortens the access util name obviously.

xopen ()
{
xdg-open “$@”;
_TMP_EXITCODE=$?;
if [ “${_TMP_EXITCODE}” == “1” ]; then
echo “[ERROR:] Error in command line syntax”;
else
if [ “${_TMP_EXITCODE}” == “2” ]; then
echo “[ERROR:] One of the files passed on the command line did not exist”;
else
if [ “${_TMP_EXITCODE}” == “3” ]; then
echo “[ERROR:] A required tool could not be found”;
else
if [ “${_TMP_EXITCODE}” == “4” ]; then
echo “[ERROR:] The action failed”;
fi;
fi;
fi;
fi;
return $_TMP_EXITCODE
}

…read full blogpost here

[just.few.tuts] systemd enabled lightweight NameSpace Containers ~ QuickStart Guide

Posted in AbhishekKr, tutorial with tags , , , , , , , , , , on November 19, 2013 by abhishekkr

justfewtuts.blogspot.in [15/Nov/2013]

http://justfewtuts.blogspot.in/2013/11/systemd-enabled-lightweight-namespace.html

systemd (for some time now) provides a powerful chroot alternative to linux users for creating quick and lightweight system containers using power ofcgroups and socket activation.

There is a lot more to “systemd” than this, but that’s for some other post. Until then can explore it, starting here.

There is a utility “systemd-nspawn” provided by systemd which acts as container manager. This is what can be used to easily spawn a new linux container and manage it. It has been updated with (the systemd’s amazing trademark feature) Socket Activation.

This enables any container to make parent/host’s systemd instance to listen at different service ports for itself. Only when those service ports receive a connection, these container will spawn and act to it. Voila, resource utilization and scalability concepts.
More of this can read in detail at: http://0pointer.de/blog/projects/socket-activated-containers.html

Here we’ll see some way to quickly start using it via some custom made commands.

…..

…..

…..read full blogpost here

[techie.bond] FSF Richard Stallman reports Spying Ubuntu; Canonical getting offensive

Posted in AbhishekKr, Uncategorized with tags , , , , , , , , on December 11, 2012 by abhishekkr

techiebond.wordpress.com [10/Dec/2012]

http://techiebond.wordpress.com/2012/12/11/fsf-rsm-reports-spying-ubuntu-offensive/

One of the most (the most for some years) popular Debian-based Linux Distro, Ubuntu has been found to be using a user behavior analyzing feature to serve more user need accurate advertisements.

RSM did compared it to a proprietary malware product doing user surveillance for self-profit. As in selling out there users for money which trusted the software because of it’s promotion by various OpenSource promoters and users (at least me and people I know) tried/use it  under the pretenses of it being on the guidelines of Free Software.

…..

There have been a reply to it by few people, one being from Jon Bacon (some Ubuntu Community Manager) which came to my notice from HackerNews Top List.

He calls RSM being Childish on his stand…..

…..click here to read full post

[tekwalk] [puppet] quick PuppetMaster Service Script

Posted in Uncategorized with tags , , , , , , , , , , , on July 3, 2012 by abhishekkr

tekwalk.blogspot.com [25-April-2012]

http://tekwalk.blogspot.in/2012/04/quick-puppetmaster-service-script-for.html

#!/usr/bin/env ruby
module PuppetMaster
  def self.puppetmaster_cmd
   ‘puppet master –debug –verbose’
  end
  def self.start
    puts “Starting Puppet Master in Debug+Verbose+Daemon mode logging to /var/log/puppet/a.log”
    puts “Started.” if system(“#{puppetmaster_cmd} >> /var/log/puppet/a.log”)
  end
  def self.stop
    puppet_master_ps = %x{ps aux | grep -e ‘#{puppetmaster_cmd}’ | grep -v grep}
    puppet_master_pid = puppet_master_ps.split[1]
    if system(“kill -9 #{puppet_master_pid}”)
      puts “PuppetMaster with pid:#{puppet_master_pid} has been killed.”
    else
      puts “Failure killing PuppetMaster with pid:#{puppet_master_pid}.”
    end
  end
  def self.status
    puppet_master_ps = %x{ps aux | grep -e ‘#{puppetmaster_cmd}’ | grep -v grep}
    puppet_master_pid = puppet_master_ps.split[1]
    if puppet_master_pid.nil?
      puts “No PuppetMaster found.”
    else
      puts “Running @ #{puppet_master_ps}”
    end
  end
end
case ARGV.first
when ‘start’
  PuppetMaster.start
when ‘stop’
  PuppetMaster.stop
when ‘restart’
  PuppetMaster.stop
  PuppetMaster.start
when ‘status’
  PuppetMaster.status
else
  puts <<-PMUSAGE
$service puppetmaster (start|stop|restart|status)
PMUSAGE
end

[tux.install] have a redirecting link to download ~ cURL it down

Posted in install-on-linux with tags , , , , , on May 31, 2011 by abhishekkr

@ tuxinstall.blogspot.com [04/April/2011]

http://tuxinstall.blogspot.com/2011/04/want-shell-command-to-download-package.html

want a shell command to Download a package, but it has a Redirecting Link…
CURL it down

…..website similar to SourceForge.net, where if you copy the final redirected link and paste it in your script that would’t work after some moments…..

…..which can be used very easily to download the resource after following the redirected link at the time of execution… and the savior is our same old CURL.

…click here to read in detail

[tuxinstall.blogspot.com] Installing FreeSWITCH on Linux

Posted in Blogroll, install-on-linux with tags , , , , , , , , , , , , , on September 2, 2010 by abhishekkr

@ tuxinstall.blogspot.com [2/Sep/2010]

http://tuxinstall.blogspot.com/2010/09/deploy-installing-freeswitch-voip-on.html

FreeSWITCH on RedHat, Fedora, CentOS
To Install ‘FreeSWITCH’ on CentOS/RedHat/Fedora
Installing Dependencies {Require Internet}
===========================================
yum -y install autoconf automake libtool …….
……. libvorbis-devel libtiff-dev …click here to read full BlogPost

[justfewtuts.blogspot.com] automate process ‘kill’ of multiple instances

Posted in Blogroll, tutorial with tags , , , , , , , , , , on August 11, 2010 by abhishekkr

@ justfewtuts.blogspot.com [11/August/2010]

http://justfewtuts.blogspot.com/2010/08/linux-to-kill-multiple-instances-of.html

aw(Kill) all instances:

it has been happening in Linux where sometimes I need to…….
…….automated it with help of AWK

so here is a command/script you can use to automate it in …click here to read full BlogPost