A web development/programming blog providing info, tips, and tricks on programming languages, scripting, Linux, MySQL and more
Posts tagged Command-Line
Cheat Sheets
Jun 28th
This page will house all the Cheat Sheats that I have written. If you have a request for a cheat sheet that you would like to see, or changes to an existing cheat sheet, you can email me at admin[at]poundbangwhack.com.
Post to Twitter
Jun 19th
This is my first Shell script for public release. Twitter is blocked at my workplace so this script allows me to use cURL and the Twitter API to post from the shell of my server.
The script requires only one variable in the configuration which is your username. You are prompted for your password each time you run the script to tweet. If you have a url you would like to share, the script will connect to the is.gd API to shorten the URL. The script will then subtract the length of the shortened url from the 140 total, as well as the space required to retweet (RT @username) the message for a total length available for the tweet. If you go beyond this length, you will be notified how far over you’ve gone. The script then sends the tweet via cURL with your message followed by the shortened URL at the end.
Information
-
@name Post to Twitter @filename post_to_twitter.sh @description This script will post to your twitter account from a Linux shell. You will need to enter your username in the configuration section. You will be prompted for your password each time you run the script. @author Mark Stoecker @version 0.1
Installation:
- Click here to download this script
- You can also download this through your Linux shell with the command:
wget http://www.poundbangwhack.com/scripts_source/shell/post_to_twitter.sh.txt - Once downloaded, upload the file to the home directory of your server/computer and save it with a .sh extension:
mv ~/post_to_twitter.sh.txt ~/post_to_twitter.sh - Add execute permissions to the script with
chmod a+x ~/post_to_twitter.sh - Run the script with the command
~/post_to_twitter.sh
Configuration:
- Open the script in any text editor and edit the line
u=""by adding your Twitter username between the quotes.
Bugs:
- No known bugs at this time
To Do:
- Nothing to do at this time
As always, if you have comments or suggestions, please share them below and they may be included in future versions of the script.
Shell Scripts
Jun 19th
This page will house the Shell Scripts that I have developed. Shell scripts are run from a Linux Command-line or SSH interface.
Post to Twitter
Update your Twitter account from the shell
How to Post to Twitter from a Linux Shell
Jun 18th
I had a little downtime today at work and decided to write a shell script that I could use to tweet from the shell of my Linux server. The reason is that Twitter is one of many social networking sites that is blocked at my workplace. However, I do have access to my server and found a great one-liner on commandlinefu.com to update twitter via curl. I decided to expand on this a bit and wrote a shell script that offers a bit more than merely posting a tweet. Check out my shell script to post to Twitter here.
What is the Difference Between RPM and YUM?
May 21st
Anyone who is familiar with just about any Linux distribution has had to install software at some point or another. If it’s a process you’re not familiar with, what’s the first thing you do? You turn to Google of course (or Scour). Inevitably you have come across an article instruction you to install the software with the RPM command, while another one tells you how to do it with the YUM command. The question then comes up:
What’s the difference between installing software using RPM vs. YUM?
Type carefully: The difference between /. and ./
May 20th
Today’s post is a friendly reminder for all you fat-fingered typers out there:
Be very careful when using a Linux command-line/SSH interface not to mistype, especially when you are the root user.
This is something that I am sad to say I have come across on more than one occasion at my job (server technical support). Tiny little mistakes can wreak havoc on your computer/server if you mistype while using the command-line/SSH.
Read the rest of this entry »

