Linux.com

Home Linux Community Community Blogs

Community Blogs



Scripting made fun

I have never been a fan of programming or scripting. Thought is was a skill I was unable to learn. When learning to administer a Linux system, scripting can not be avoided.

One of the skills every sysAdmin must learn is scripting. The benefit of scripting is to automate a task or job that is constantly run every time a system is running. A sysAdmin can make that job run on its own and concentrate on other tasks that are not so easily automated. These scripts are either written using a text editor, the shell, or, scripting language.

I was not automating anything, just getting used to writing scripts. When I was studying "Linux essentials" in preparation for the Linux certification, I was practicing passing variable values. That is, printing the value of one of my system's default variables. I had a crazy thought. What if I actually ran a script using a variable. I soon learned, Linux is what you make of it.

There are default variables already set on a Linux system. To find what these variables are, you simply type this command in a shell or terminal emulator, “printenv”

This is a screen shot of the default variables on my Linux Mint 17 system.

XDG_VTNR=7

SSH_AGENT_PID=1808

XDG_SESSION_ID=c1

TERM=xterm

SHELL=/bin/bash

XDG_SESSION_COOKIE=9f6e6efa3c8a79091dbec7c85403e053-1410643266.227255-1746036259

WINDOWID=35651588

GNOME_KEYRING_CONTROL=/run/user/1000/keyring-ccaIQh

USER=x

LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:

OPENDVD=eject /dev/sr0

SSH_AUTH_SOCK=/x

PLAYMEDIA=vlc /dev/sr0

SESSION_MANAGER=x

USERNAME=x

DEFAULTS_PATH=/usr/share/gconf/default.default.path

XDG_CONFIG_DIRS=/etc/xdg/xdg-default:/etc/xdg

PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games

DESKTOP_SESSION=default

GDM_XSERVER_LOCATION=local

PWD=/etc

GNOME_KEYRING_PID=1585

LANG=en_US.UTF-8

MANDATORY_PATH=/usr/share/gconf/default.mandatory.path

MDM_XSERVER_LOCATION=local

GDMSESSION=default

SHLVL=1

XDG_SEAT=seat0

HOME=/x/x

XDG_SESSION_DESKTOP=default

LOGNAME=x

XDG_DATA_DIRS=/usr/share/default:/usr/share/xfce4:/usr/local/share/:/usr/share/:/usr/share/mdm/

DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-ONZKNCkspd,guid=10fed374626ed9dae74c359c5414b544

MDMSESSION=default

TEXTDOMAIN=im-config

WINDOWPATH=7

XDG_RUNTIME_DIR=/run/user/1000

DISPLAY=:0.0

MDM_LANG=en_US.UTF-8

TEXTDOMAINDIR=/usr/share/locale/

COLORTERM=xfce4-terminal

XAUTHORITY=/x/x/x

_=/usr/bin/printenv

Take a close look at the bold text above. These are my custom variables I set to run some custom scripts.

OPENDVD=eject /dev/sr0 is used to open my laptop's DVD disc drive.

PLAYMEDIA=vlc /dev/sr0 is used to play a DVD using VLC.

Of course I could have just written the scripts using a text editor. I wanted to make things more interesting by try something different. Also, doing this helped me learn and appreciate environmental variables much more. I find them really fun to play with.

Always remember this syntax, "command argument". The command is what you want to run, the argument is what you want it to run on. The command “VLC” opens the VLC media player program. The argument “/dev/sr0” is the DVD disc drive I want it to open. Typing this in your terminal will do just that.

If you look at the subfolder “etc”, you will notice a file named “environment”. You can actually use this filie to create and store your own custom declared variables. On some Ubuntu based systems, you might noticed the default “PATH” variable is also located there. A little F.Y.I.

Once you set your desired variable, and save the file, restart your system. Run the “printenv” command and you will see your variables listed.

To set a variable, type in all caps, the name of the variable, then after that, the “=” sign and then the value that the variable will relate to. Like this, VARIABLE=value. In my case I typed, OPENDVD=”eject /dev/sr0”. The quotes surrounding the command indicates that the command should be treated as one value.

Once this is written, I had reset my mint system. Once logged in, and the terminal was opened, I called the value of the new variable. This is when you tell your terminal to print the value of a variable. The command to do this is, prompt<$VARIABLENAME>.When I typed, “$OPENDVD”, my dvd disc drive opens. Your system will recognize a variable when it starts with a dollar sign followed by a name in all caps as in, "$OPENDVD".

I was not big on programming. Yet, scripting, using variables, not only makes Linux even more interesting but programming as well. I already have a large list of scripts I want to experiment with. When I think about it, scripting might actually be my thing. I went beyond just learning what a variable is. I begun learning how to talk to Linux using my own language.

 

Wearable Electronics Market - Latest Technology Research Report and Industry Analysis, 2014 - 2020

Wearable electronics are accessories with advanced electronic technologies. Wearable devices are worn on the body, which enable wireless networking and mobile computing. These devices enable end-users to integrate computer in their daily activity and use technology to take advantage of advanced features and characteristics. Wearable electronics devices include product such as smart goggles, finger worn scanners, wrist wears such as wrist bands and electronics watches, foot wears namely fitness and sport shoes and athletic shoes, and others products such as neck-wear and head bands. Increasing proliferation of smart watches and smart glasses and their ability to share data with smart-phone are expected to drive the growth of wearable electronics market over the forecast period. However, high initial cost of these devices will restrict the growth of this market to some extent.

Read More @ http://www.transparencymarketresearch.com/wearable-electronics-market.html

The wearable electronics market can be segmented into four major types into components, product, applications, and technology. The wearable electronics market can be segmented on the basis of types of components into seven major categories namely networking and positioning components, power supply components, sensing components, optoelectronic and display component, controls components and interface components.

On the basis of product the wearable electronics market can be segment into six categories namely wrist-wear, eye-wear, body-wear, foot-wear, neck wear and others (head-wear and finger wear). The wearable electronics market can be segmented on the basis of size of applications into four categories which include healthcare application, consumer application, industrial applications and commercial applications. On the basis of technology the market can be segmented into six categories namely display technologies, computing technologies, positioning technologies, networking technologies, speech recognition technology and sensor technologies. The market can also be segmented geographically into North America, Europe, Asia Pacific and Rest of the World (Latin America, Middle East and Africa).

Some of the key drivers of this market include increasing demand for sophisticated gadgets with advanced features, enhanced adoption of wearable electronic products in new applications and shifting trend towards communication and networking technologies for wearable electronics, which are the biggest revenue generators for wearable electronics market. The key restraints to this market are high initial cost, privacy concerns, and poor consumption, which are hindering the growth of this market.

Some of the key players in the wearable electronics market are Apple Inc., Adidas AG, Google Inc., AT & T Inc., Glassup SRL, Epson Corporation, Imprint Energy Inc., Infineon Technologies AG, Nike Inc., Shimmer Research Inc. and weartech S.L among others. 

 

Connected Living Room Market - Latest Technology Research Report and Industry Analysis upto 2019

The report titled ‘Connected Living Room - Global Forecast, Market Share, Trends, Size, Growth And Industry Analysis, 2013 - 2019’ delves into the contemporary concept of living rooms that are centered on advanced entertainment and communication devices. The report takes into account various dynamics that are expected to work in tandem so as to bring about a change in the devices and technologies in new-age living rooms.

Read More @ http://www.transparencymarketresearch.com/connected-living-room.html

This report can be described as a comprehensive study of current trends in connected living rooms. With technological advancements rapidly taking place in this sector, this report is integral to the strategy of both established as well as incumbent market players.

It features end-to-end analyses of market propellants as well as inhibitors. The report provides users with accurate market projects for the years ahead. Besides a value chain analysis, the report also provides a market share analysis based on market segments and geographical markets.

The report also offers a statistics-based projection of the emerging trends in this market that will play a key role over the next few years. Developments that have taken place over the recent years are extensively analyzed in this report. Yet another highlight of this study is the use of Porter’s five force model analysis as well as detailed Company Profiles section that takes into account the strategies, financial standing, and strengths and weaknesses of leading names in this sector.

Market overview

The concept of a connected living room is relatively modern and entails the use of technological devices and gadgets that provide a combination of information and entertainment depending on the choices of the user. With a connected living room, a user can share photos, music, and videos enabled by devices such as smart televisions, set-top boxes, and personal computers.

According to the findings of this report, the market for connected living rooms is anticipated to witness healthy growth, with single-digit CAGR increase by the end of 2019. Some of the devices that constitute a connected living room are, plasma TVs, smart TVs, DVD players, OLED TVs, video recorders, audio and gaming consoles, among others.

There are a variety of factors propelling growth in the connected living rooms market. These include: a growth in the demand for digitization, the growing preference for advanced display equipment, and the emergence of novel technologies and platforms for sharing information and entertainment. At the same time, there are a few factors that have been hindering the market from reaching ideal growth figures. These factors include a lack of user-friendliness of these noticeably high-tech devices as well as their high costs.

 

First milestone of UCS 4.0 released

Univention has released the first milestone of its Enterprise Linux distribution Univention Corporate Server. New features:

  • based on Debian 7.6 aka "Wheezy"
  • new Linux kernel 3.16
  • a prerelease of Samba 4.2
  • the LDAP directory service now with the better performing MDB backend.

The milestone aims at channel partners, technology partners and interested parties who want to take a first look at the upcoming release of Univention Corporate Server (UCS) which will be released in November.

Further information at: http://blog.univention.com/technical-overview-ucs-4-0-preview/

 

Linux Debian with PXE and AOE server to install windows 7/8

I wanted to be able to install Win7 over PXE but got a head acke when I read a few tutorials about it and thought to myself there should be a easier quicker way. Indeed there is using AOE (ATA Over Ethernet). I found a nice howto here but it is aimed at a Windows Server. I came up with a way to do this in Linux.

This will work on Debia Squeeze and Wheezy. I have not tried this with the Windows 7 CD, only tried this with my jump drive.

Software needed

  • Base system of Debian
  • DNSMasq - via APT
  • iPXE boot CD
  • Syslinux - via APT
  • vblade - via APT
  • Windows 7 or 8 in jump drive form

Install DNSMasq and Syslinux with apt -- sudo apt-get install dnsmasq syslinux -- Configure DNSMasq with nano or vi to your liking -- sudo nano /etc/dnsmasq.conf --. You can use my config if yo wish.

interface=eth1
listen-address=127.0.0.1
domain=
dhcp-range=192.168.0.50,192.168.0.150,12h
dhcp-boot=pxelinux.0
enable-tftp
tftp-root=/tftpboot/
log-queries
log-dhcp
 
We also need to make the NIC to run a static address. As you can see I am using eth1 but you might be using eth0 so keep in mind yours might be different. To give your NIC a static address edit -- sudo nano /etc/network/interfaces -- here's mine for a example.
 
allow-hotplug eth1
iface eth1 inet static
        address 192.168.0.1
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
 
Just make sure you use the correct IP subnet that matches DNSMasq. After editing the interfaces file you need to restart the device. -- /etc/init.d/networking restart --
 
We can now move on to the PXE layout. The root directory I use is /tftpboot so i'll use it in the tutorial.
create a new directory for tftp -- sudo mkdir -p /tftpboot --  and also -- sudo mkdir -p /tftpboot/pxelinux.cfg --
Copy a couple of files from syslinux to the tftpboot directory -- sudo cp /usr/lib/syslinux/menu.c32 /tftpboot -- -- sudo cp /usr/lib/syslinux/pxelinux.0 /tftpboot -- After that we can create the default file for PXE -- sudo nano /tftpboot/pxelinux.cfg/default -- Here is a simple setup I use.
 
DEFAULT menu.c32
PROMPT 0
MENU TITLE PXE Boot
TIMEOUT 100

LABEL Install Win7
MENU LABEL Install Win7
kernel ipxe.krn
initrd conf.ipxe

Just save and exit. Now download iPXE's boot CD and mount it. -- wget http://boot.ipxe.org/ipxe.iso -- to mount it issue this -- sudo mount -o loop ipxe.iso /media -- cd in to /media and copy boot.cat and ipxe.krn to the root of the tftpboot directory. -- sudo cp boot.cat ipxe.krn /tftpboot -- unmount the ipxe.iso --sudo umount /media -- Now we need a config file for iPXE to boot a AOE. -- sudo nano /tftpboot/conf.ipxe -- It should look like this

#!ipxe
dhcp net0
set keep-san 1
sanboot aoe:e0.1

In all tha was the hard part. The easy part is setting up AOE. Debian's kernel has the module ready to go but has to be enabled. -- modprobe aoe -- now we need to add it to the modules file so it is loaded when the system boots. -- sudo nano /etc/modules -- Should look like this

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.

aoe
loop

Now install vblade -- sudo apt-get install vblade -- Copy the Win7 or 8 USB jump drive using disk dump. I put mine in the /tftpboot/win7 directory. -- sudo mkdir -p /tftpboot/win7 -- -- sudo dd if=/dev/sde of=/tftpboot/win7/win7.img bs=4M -- It will take about five or ten minutes to copy. When finished we can start vblade. -- sudo vbladed 0 1 eth1 /tftpboot/win7/win7.img -- You can create a script or even issue it in the rc.local file to start everytime the system boots. All what is left is to restart DNSMasq and test it out with Virutal Box or a real system. -- sudo /etc/init.d/dnsmasq restart --

Hope you'll enjoy this tutorial.

 

Make Downloading Files Effortless

A download manager is computer software that is dedicated to the task of downloading files, optimizing bandwidth usage, and operating in a more organized way. Some web browsers, such as Firefox, include a download manager as a feature, but their implementation lacks the sophistication of a dedicated download manager (or add-ons for the web browser), without using bandwidth optimally, and without good file management features.

<A HREF="http://www.linuxlinks.com/article/20140913062041384/DownloadManagers.html">Complete article</A>

 

A low cost industrial single board computer base on TI Sitara AM335X processor

Forlinx Embedded(http://www.forlinx.net/), a company based in Baoding, Hebei, China specializing in embedded systems design and manufacturing, has recently launched OK335xS-II single board computer powered by Texas Instruments AM335x SoC which should be “the cheapest industrial Cortex-A8 board in history” as it sells for as low as 298 RMB or about $49.
Forlinx_OK335xS-IIOK335xS-II board is comprised of a baseboard and a CPU module soldered to the base board with the following specifications:
SoC – Texas Instruments AM335X ARM Cortex-A8 processor @ 800MHz with PowerVR SGX530 GPU
System Memory – 128M DDR3 + micro SD slot
Storage – 256MB SLC NAND Flash
Display I/F – LCD interface with support for LCD to LVDS and LCD to VGA, and resistive touchscreen interface
Connectivity – 1x 100M Ethernet
USB – 1x USB 2.0 host, 1x mini USB 2.0 device
Serial – 5x serial port (1x debug interface, 4x TTL port)
Expansions headers – 5 headers with access to
7x AD (2x for user, 1x for slide rheostat, 4x for resistive touch)
1x I2C, 1x SPI
1x I2S
2x CAN
3x PWM(1x backlight, 1x buzzer, 1x user expansion)
8x GPIOs
Misc – 2x LEDs, 3x user keys, boot and reset key, boot switch, battery for external RTC chip
Power Supply – 5V
Dimensions – 52 x 42mm (CPU module); 104.2 x 81 mm (Baseboard)
Operating Temperature Range – -40℃ to +85 ℃
Relative Humidity – 10%~90%
what 's more, 4.3”, 5”, 7”, 8”, and 10.4” LCD could be provided to work with the board, Wi-Fi can be added via SDIO or USB, and the boot switch is used to select between NAND or SD card boot.
Both Linux 3.2 and Win CE6.0 are supported, and the board apparently sells pre-loaded with Linux 3.2. WinCE OS will be officially released soon. “abundant documentation” with Linux and WinCE software manual, a Qt development guide, and various sample programs are provided. 

For more details, please visit www.forlinx.net.

 

Install Git 2.1.0 on Ubuntu 14.04, 12.04 and LinuxMint 16/15

Git has released 2.1.0 version on Aug 15, 2014. Git is a free and open source distributed version control system . Git 2.1 comes with the number of noticeable changes than 1.9 versions. It is designed to handle a small to very large projects with speed and efficiency.


Read more at  http://tecadmin.net/install-git-on-ubuntu/

 

Why application hosting?

I have often faced questions like: what application hosting means and how it becomes handy to small and mid sized business?  It is a common concept, but will be very difficult to understand if not given correct definitions. Let me try to explain it thoroughly.

       

                                               

Firstly, you should keep in your mind Application Hosting as ASP (Application Service Provider), SaaS (Software-as-a-Service), On-Demand software, or simply Outsourcing of your few IT needs.  Though all of these keywords are correlated, they are not completely interchangeable, but the concept is the basically the same and fairly simple.

 

What Does Application Hosting Mean?

 

Application hosting is a software application distribution system where your application - CRM, tax and accounting application or other custom applications, are maintained and managed by a qualified service provider and made available to you, as a service over the Internet.  So, it means that your applications are not going to reside on your in-house setup, it is going to be installed on the servers of hosting provider. The application can be easily accessed and shared by your company staffs, through a web browser. So, in the case of application hosting, the software hosting vendor is responsible for 24X7support, maintenance, installations, upgrades and security.

 

What is a standard hosting Provider?

 

The major characteristics of a  standard application hosting provider is a company that has either developed the application and/or is certified by a software manufacturer. The major core benefit of having a standard hosting provider is that they have extensive working experience on related technologies and they know all the ins and outs.  They know exactly how to make the application work and are able to support you with best available practices.

 

What are the Highlights of a standard hosting:

 

With an excellent hosting service, you should get the following:

  • Efficient backup practices to ensure data integrity

  • Instant setup and migration

  • Easy to use

  • Reduced cost with software, infrastructure and IT staff

  • 24X7 technical support

  • Automatic and frequent upgrades

  • Ability to adopt new technologies

 

What are the major Benefits:

The major benefit of application hosting is that you have a common platform for your practices instead of having separate desktops for each individuals. This helps you to share a common data base to each, improving your team collaboration and overall productivity.  In addition, you will get:

  • Sharing the information at a single platform

  • Enhanced company image and customer loyalty

  • Reduced costs and increased revenue

 

What kind of business entities look to host?

 

Since, application hosting is adopted a general practice, small and medium sized businesses are more aggressive to go ahead. Tax and Accounting firms have adopted application hosting as their core platform. QuickBooks hosting provider helps them to solve their purpose. 

 

Free Office Suites that Cut The Mustard

Microsoft Office still dominates market share of office suites. Businesses have often rejected free Office alternatives. However, whether this will continue is uncertain. With the cost of a price plan for Microsoft Office, the average home user or small business will welcome a free alternative. Fortunately, there are some truly excellent free alternatives available for Linux (and other operating systems). Not all of the office suites featured here are released under an open source license, but they are all free to download and use without charge.

<A HREF="http://www.linuxlinks.com/article/20140824033911347/FreeOfficeSuites.html">Complete story</A>

 

Beware of BD_STATUS Alarms by Cross-Connect Boards of OptiX OSN 3500

Summary:
Creep occurs on SD585 soldered balls of some cross-connect boards on  Huawei transmission OptiX OSN 3500 equipment so these boards repeatedly reset, fail to work, and report BD_STATUS alarms.

Huawei OSN 3500

[Problem Description]
Trigger conditions:
There is a possibility that this problem occurs as a result of long-term exposure of the boards involved to high temperature.
Symptom:
1. Boards are reset repeatedly and fail to work.
2. NEs may report BD_STATUS alarms or COMMUN_FAIL alarms on cross-connect boards.System control boards may report BIOS_STATUS alarms on cross-connect boards.
Identification method:
The problem can be identified if the following two conditions are met:
1. The boards are manufactured in Feb 2010, Apr 2010, May 2010, Jul 2010, Aug 2010, or Mar 2011.
2. The cross-connect boards are repeatedly reset and fail to work. The board BOMs are found in the attached Board Delivery Information.
[Root Cause]
The SD585 chip radiator uses the thick spring, which applies high levels of stress to the chip. The soldered ball of the SD585 chip may deform and short-circuit as a result of long-term exposure to high temperature. Therefore, the board repeatedly reset and fail to work.

[Impact and Risk]
1. Services are not influenced because of the 1+1 protection scheme is configured on the cross-connect boards. When a cross-connect board is faulty, services are switched over to the other cross-connect board.

2. In extra situations, both cross-connect boards configured in the 1+1 protection scheme become faulty in a short time. As a result, the NE fails to work and services are interrupted.
[Measures and Solutions]
Recovery measures:
Replace the faulty cross-connect board.

Reference and buy new similar boards in  Huawei network product distributors 

Preventive measures:
None
Solution:
Replace the faulty boards.

Material handling after replacement:

Return the spare parts for repair.

[Rectification Instructions]
Replace the faulty boards.
SSN1SXCSA02 (03030KBM) boards are out of production, so replace SSN1SXCSA02 boards with SSN1SXCSA01 (03030DKF) when filling in an electric process application for board rectification in batches. The two kinds of boards can be mixedly inserted or completely replace each other. Active and standby boards of the same type are recommended.

 
  • «
  •  Start 
  •  Prev 
  •  1 
  •  2 
  •  3 
  •  4 
  •  5 
  •  6 
  •  7 
  •  8 
  •  9 
  •  10 
  •  Next 
  •  End 
  • »
Page 1 of 142

Upcoming Linux Foundation Courses

  1. LFS230 Linux Network Management
    06 Oct » 09 Oct - Virtual
    Details
  2. LFS416 Linux Security
    06 Oct » 09 Oct - Washington
    Details
  3. LFD331 Developing Linux Device Drivers
    13 Oct » 17 Oct - Virtual
    Details

View All Upcoming Courses


Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board