Effective way of using bash scripts to start command line applications
Due to the fact that I use the eee PC as my means getting Linux portable, I often had to figure out ways to minimise memory and harddisk usage, so as to speed things up even more. So in this quest, I stumbled into the world of "command line Linux". It seems a little unnerving to me at first, as I considered myself an average Linux desktop user, who never ventured into DOS even back in those days when I used Windoze. But I googled and figure out a way to use command line applications, with less repetitive typing. In short, I use bash scripts.
What I do is I write a bash scripts that run a certain simple application, and I then I put the bash script as an entry in my desktop menu ( I run icewm, by the way). Just to illustrate how to do it, for other beginners. This is how I do it.
Below is a very simple bash script to connect my pc to my home network. Of course, the details of the encryption key and ESSID is fake and arbitrary. And "ath0" is my network device.
sudo ifconfig ath0 down
sudo iwconfig ath0 essid lala key 0123456789
sudo ifconfig ath0 up
sudo dhclient ath0
So I created the bash script and store the file as /home/user/homeconnect.sh, you can of course store it anywhere. Then I have to make the script executable by going to /home/user directory and "sudo chmod +x homeconnect.sh"
Then I go to "~/.icewm/menu". That's where the icewm menu settings can be made. I save the menu after I add in this new line "prog 'homeconnect.sh' icon xterm -e /home/user/homeconnect.sh". I don't need an icon for this entry so the "icon" term is just arbitrary.
So that's done. When I right-click my desktop, I'll see an entry "homeconnect.sh", and when I clicked it and it autoruns the script and connects me to my home network.
1) Command line apps will use less resources then GUI apps.
2) Learn more about bash scripts and how to use the command line more effectively.
3) Uber-geekiness factor increases. Haha.
1) It takes a certain balls to try it first for a beginner.
Of course, the bash script is too simple. I have progressed and now my script allows me to key in ESSID and encryption keys to log into other familiar networks and even lists out the networks in the area for reference. Trick is "sudo iwlist ath0 scan | grep -e ESSID -e key -e Quality".
Have fun with this howto and maybe you can share your bash scripts for other tasks that you do. =)
Well, this is a surprise for me! one of the oldest Linux Distributions (which is also my favorite): Slackware, is getting ready to have a X86_64 (aka amd64) version at their next release, currently the 64bit version is available only at the Slackware-current branch and not intended for production use of course.
This version will be multilib which means it will include 32 and 64 bits version of the libraries, contrary to the polemic Bluewhite64 Slackware port which only uses 64 bit libraries.
It will be very interesting what does this means for the unofficial Slackware ports around there and mostly for Slamd64 which was the first 64bit port of Slackware.
This is my first writing to the linux.com community blog, I havn't known what it will look like after published, but I like this idea. The community blog idea. A community needs to blog itself!
First, let me introduce myself. I am a young linux hacker lived in Shenzhen, China. Here is also many people love linux and get gatherings peiodically or unperiodically, there are always some just Linux distro hackers, try a distobution for curiosity and adventure, and may choose another after months, those freshmen! And there're also some ones like me, programmers, or deep hackers, I am a linux kernel hacker, I've contributed some kernel patches and I will contribute more, I love the kernel hacking. In some gathering we just play some distros, while in others we program together. I think I should and I will report those interesting events here.
Then let's look what it will look like, Let it rip!
While trying to save a blog post, I clicked small PDF icon beside print icon on top of blog post, it saved a pdf file with the summary of latest blog posts.
The post I was trying to save was in the pdf file but with 2-3 unwanted posts and it was only the summary, not the whole post.
I think this should be fixed, PDF icon when clicked on a post should only save THAT post, not the summary of all the posts.
Requesting Linux.com admins to fix or correct me if I am wrong or missunderstanding something.
Here's a quick post with few quick and dirty commands for creating/burning cd/dvd from the command line.
Graphical tools are nice but even boring and slow, if you've few bash scripts you'll see how fast you can handle with CDs with no worry
Here's what I do to create an ISO, let's take an example, you've a dir full of Virtual machines, images or whatever you want, let's create an ISO from it
~$ cat bin/iso.create
mkisofs -V 'label' -A 'label' -R -joliet-long -o 'image.iso' $1
This script takes directory name as input an creates an iso "image.iso" ready for storing or burning
Here's what I do for burning a DVD/CD
~$ cat bin/iso.burn
sudo cdrecord -eject -verbose $1 -dev=/dev/cdrw
Script takes ISO filename as first parameter so you can burn easily for favorite CD distro without too much troubles, /dev/cdrw is the name of your dvd/cd burner, after finishing its job the cd is ejected so you can see it
Hope it helps
Really just posting this to test out the system and to say hello. Hello. Ok, now that that is completed I'll get down to something a little less inane. I've been using Linux since around the time of Red Hat 4.2. A KDE user since 0.1 (on FreeBSD then)
My first Linux distribution was of all things called Alzza Linux, a Korean distro based on Red Hat, and hard as heck to install because I don't read Korean. (I was living in Korea at the time) Later, I was a hard core user of Mandrake until Gael Duval departed, and a long time "answer man" (of many) on the Mandrake Linux Experts mailing list.
These days I can be found using Kubuntu (don't do Gnome, like XFCE, I think LXDE rocks.) Android, and Debian. My main laptop, Netbook, Handheld (N800 and 770) and phone (G1) all use Linux. My one concession is that my wife is on OSX.
I've been recently given a new lease on life, or in more accurate terms, laid off, and have taken a bit of time for myself and my family, now I'm hitting the boards and look for work, nationwide.
I plan of periodically dropping in. Posting some "hey look what I found" and "ooh neat" type articles that I really hope will help others as much as learning how to do them helped me.
You know it’s bad for Microsoft’s financial department, especially with the kind of numbers they crunch, when they can’t even perform basic multiplication. Seriously, people. it’s been 20 years, figure it out.
What am I talking about?
The “Excel 2007 Multiplication Bug,” as outlined on Slashdot:
“The example that first came to light is =850*77.1 - which gives a result of 100,000 instead of the correct 65,535. It seems that any formula that should evaluate to 65,535 will act strangely. One poster in the forum noted these behaviors: ‘Suppose the formula is in A1. =A1+1 returns 100,001, which appears to show the formula is in fact 100,000… =A1*2 returns 131,070, as if A1 had 65,535 (which it should have been). =A1*1 keeps it at 100,000. =A1-1 returns 65,534. =A1/1 is still 100,000. =A1/2 returns 32767.5.’”
How many ways do I love open source? Let me count the ways. But not in Excel.
And before you get ahead of yourself, OpenOffice does this calculation properly:
Better switch to open source if you are doing any important financial spreadsheets.
This bug was fixed by microsoft later but what will happen to those users who are still using the buggy microsoft excel... I can only imagine :)
I just love Open Source :)
I liked the way of the new Linux.com. As a community portal and integration of software and the news from Linux world is the the way that it should be.
I hope this aim will keep on covering linux users all around the world, and i wish Linux.com will be %100 browser and os friendly for us. We do not like more flash animations&ads heavy scripts will be not good for many users.
And this editor Rocks light and easy to use.
I have best wishes for new Linux.com
And tihis is the end of my first log.
looking for a user group in morristown,tn or jefferson city, tn or people in this area who would like to start linux user group
Hosting, Cloud and Corporate Data Center Customers Drive Extensive List of Enhancements
REDWOOD CITY, Calif. - May 20, 2009 - LinMin, maker of award-winning LinMin Bare Metal ProvisioningTM, today unveiled Release 5.4, featuring "Turbo-Imaging," a high-performance disk imaging subsystem for disaster recovery, new operating system media management, updated Linux® and Windows® Server provisioning, extensive logging and numerous other features requested by corporate, cloud and hosting company data center managers.
Turbo-Imaging brings disaster recovery to a new level with automatic file system detection, intelligent compression and other capabilities that make it easy for data center managers to quickly roll systems back to a known-good state in case of software corruption, malicious attack or other failure. Combining server provisioning (remote, unattended operating system installation) and disk imaging in a single product makes LinMin an indispensable solution in deploying, repurposing and recovering the commodity hardware infrastructure layer used in hosting, corporate, cloud and other data center environments.
"We use LinMin extensively in our three hosting data centers for provisioning and imaging our Linux and Windows servers," said Andrew Cartwright, CTO of FiberHosting. "We are now implementing LinMin's application programming interface (API) to enable FiberHosting customers with dedicated servers to control their systems from the bare metal up. This increases customer satisfaction and reduces our own operating expenses."
"The positive feedback we're getting from customers is most gratifying," said Laurent Gharda, CEO and founder of LinMin Corp. "There is no substitute for hosting, cloud and corporate data center staff feedback to drive LinMin's roadmap for solving real world problems. As new vendors and solutions emerge to manage already-deployed physical and virtual systems, the forgotten piece of the data center cost equation remains the labor-intensive deployment, re-purposing and recovery of the hardware layer itself. LinMin helps customers optimize exactly that."
LinMin Bare Metal Provisioning 5.4 is available immediately and is available for purchase and download at http://www.linmin.com/. LinMin Bare Metal Provisioning for Linux and Windows is priced at $249 for up to 10 client systems, $999 for up to 100 client systems, $1,999 for up to 250 client systems, $3,499 for up to 500 client systems and $5,999 for up to 1,000 client systems.
LinMin provides software that remotely provisions and images Linux and Windows on servers, blades, PCs, appliances and virtual machines. LinMin Bare Metal Provisioning (LBMP) is the industry's only truly affordable system provisioning and imaging solution that can be implemented by IT organizations of any size with very limited budgets. LinMin is based in Redwood City, Calif. with development and QA offices in Menlo Park and San Rafael, Calif. For more information, please visit http://www.linmin.com/.