Airtel and MTN SMS center number for cyanogen modded android phones

0 comments

As you already know, I modded my Samsung Galaxy S2 with CyanogenMod 

At the beginning of this month I noticed something very disturbing.
I got a happy new month message from a dear friend and I tried replying and no way. I tried and tried repeatedly, I kept getting message not sent. I googled the MTN SMSC code and as expected it was still +2348030000000, I tapped that into my modded android phone and got an error. I googled all the combination of mtn + android + sms + message + error + can't send and no suggestion found worked. I switched on and off the phone severally, no result.

So for more than 8 days I couldn't send an SMS.
Then suddenly on Wednesday, like a flash bulb, an idea lit up in my head. I removed my Airtel SIM from my Blackberry and put the SIM in the android phone, then I went to the settings to see the SMSC number. To my surprise it was 089132420000000f8 instead of +2348020000000 that is in the documentation. I tried sending an SMS and it was successful. 
So I did what anyone would do.

Mastering Linux vi editor

0 comments

vi editor is a very powerful text editor that comes pre-installed on all Linux OS.
vim is variant of vi editor, basically an improved version. Practically, it is more error tolerant than vi.
There are two modes –
Command mode, which is the default mode. You basically scroll through the file content or enter commands.
h moves the cursor to the left,
l moves it to the right,
k to move up, and
j to move down
dd  will delete current line
:w to save (write) the changes made
:q will exit the editor

:q! will exit the editor without saving changes
Text input mode. You enter this mode by pressing the Insert key. There are some basic guidelines to note -
don’t attempt to scroll or change the cursor position in this mode, position the cursor where you want to add extra text before changing to the text input mode. The only exception is when you are using vim.
To change to this mode pressing -
a will append, move the cursor one position to the right before switching to the inserting mode
i will insert
o will insert a blank line under the current cursor position and move the cursor to that line
Vim is better, just not as pre-installed on Linux OSs as Vi.
Run vimtutor to start a recommended 30 minutes tutorial on using vim.

Manipulating Linux command line output

0 comments

The following are ways to manipulate the screen/standard output of any Linux command,
Piping the output to another command using |
Redirecting output via >
Redirecting output via >> (to append)
Redirecting only errors via 2>
Redirecting standard input via <
Use tee option with | (pipe) to copy input to standard output (terminal) and more than one output files. e.g. cat original | tee copy1 copy2

Use tee –a to append to files. e.g. cat file.txt | tee -a file_all.txt
Grep: It scans output line per line, searching for matching patterns.
All lines containing the pattern will be printed to standard output. e.g. cat countriesandcapitals.txt | grep Nigeria
This can be reversed using the –v option.
 Sort: It allows you to sort the output lines before displaying.
Default is in alphabetical order. e.g. cat alphabets | sort
It can also sort by file size, when sorting ls output. e.g. ls ~/ -la | sort -nk 5
And when used with uniq, it can sort and filter out double entries. e.g. sort itemlist | uniq

Setting file permissions in Linux

0 comments

All files in Linux have permissions set (or unset) for user, group and other users. It’s indicated as –rwxrwxrwx or similar.
To display a file’s permission settings, type ls -l filename
The first character indicates the filetype e.g. ordinary file, directory…
The next 3 characters indicate the permission for the file owner (user), then next 3 for users in the owner’s group and the last 3 for other users.
r = Read  w = Write  x = Execute
Easiest way to change a file’s permission is to use chmod u/g/a +/- rwx filename e.g. chmod a+w file.txt to give everyone write permission on the file, file.txt
You can also use numeric arguments and common ones are –
chmod 400 to give only read permission to owner
chmod 600 to give read and write permission to owner
chmod 644 to give everyone read permission and the owner write permission
chmod 775 to give everyone read + execute, owner + group read write execute permission
chmod 777 to give everyone read write exceute permission

Simple Linux Command line file text manipulation tips

0 comments

This is going to be short and straight to the point.

Use cat file.txt to display the content of file.txt on the screen
Use cat file.txt | more to display the content of file.txt one page at a time
Use cat file.txt | less to enable scrolling. Press q to exit/end.
Use tac file.txt to display the content of file.txt in reverse
Use cat file1.txt > file2.txt to copy content of file1 to file2, file duplication.
Use cat file1.txt >> file2.txt to append content of file1 to file2.
Use tail -10 file.txt to display the last 10 lines in file.txt
Use head -10 file.txt to display the first 10 lines in file.txt

Useful Linux command line tips

0 comments

Linux has become extremely easy to administer. And can be administered using GUI applications or using the Command line Interface (CLI)
As a professional Linux administrator, you’ll have to know how to administer the OS via the CLI
Linux supports multi-tasking, several users using the OS simultaneously.
By default 7 users can work simultaneously (without anyone logging out). 6 Commandline users and 1 GUI user. To switch use CTRL + ALT + F1 (F2,F3,F4,F5,F6,F7) . CTRL+ALT+F7 takes you to the GUI one
From the GUI, you can always access the command line via “Terminal”

Below are very useful command line tips

Understanding the different file types in Linux

0 comments

Ever wondered why you see different colors when you do ls in linux?
In this post I'll show you what each color stands for. 

In the screenshot below, I did ls -l which will show extra details - file type, file permission, file owner, owner's group, date of creation/modification and file name.
'Cos I did this on my android phone which runs a stripped version of Bash shell, the colors aren't showing. If you do this on a Linux PC, the file names will be colored differently.



Learn Unix/Linux

0 comments

Want to put your Unix/Linux skills on steroid?
Checkout the presentation below


 
Follow me on Twitter | About me | Terms of Service | Privacy Policy