Archives 2015

linux bash shell command aliases Command substitution globbing

linux bash shell command aliases Command substitution globbing

1.bash shell command aliases:

##### alias CMDALIAS = 'COMMAND [options] [arguments]'
##### Shell aliases defined only valid in the current shell life cycle; effective range of only the current    shell process alias:
 eg. [root@levi ~]# alias cls=clear
Cancel command aliases:
[root@levi ~]#unalias CMDALIAS
the same alias command ...

Continue reading

jQuery plugin - Cookie plug jquery.cookie.js

jQuery Cookie Download: https://codeload.github.com/carhartl/jquery-cookie/legacy.zip/v1.4.1

1. The introduction of jquery.cookie.js

<Script src = "scripts/jquery-1.6.4.js" type = "text/javascript"> </script>
<Script src = "scripts/jquery.cookie.js" type = "text/javascript"> </script>

2. Use

1) add a new session cookie:
$.cookie ...

Continue reading

linux help command Summary notes

Linux help command : help,--help,man,info

type command : View command type(Internal Command,External Command)
eg.:
[root@levi ~]# type -a cd 
cd is a shell builtin (Internal Command)

[root@levi ~]# type -a grep 
 grep is /bin/grep    ( External Command)
1.Internal Command (Help view)
help COMMAND
2.External Command (help view)
COMMAND --help
3 ...

Continue reading

linux Execute shell script exception bad interpreter: No such file or directory

linux sh script exception /bin/sh^M:bad interpreter: No such file or directory

reason : This is caused by a different system encoding formats.

resolve : 1.Conversion at windows

        Use UltraEdit or EditPlus

        UltraEdit: File-->Conversions-->DOS-->UNIX

        EditPlus : Edit-->EOL Conversions-->Convert to UNIX Format


        2.Conversion with vi

        >vi filename

        :set ff or :set fileformat

        You can see ...

Continue reading

linux c library function to read binary file code

linux c library function to read binary file code

struct person
{
    int id;
    char name[20];
    int age;
    int sex;
    char tel[20];
};


int main(int arg, char *args[])
{
    FILE *p = fopen(args[1], "w");
    if (p == NULL)
    {
        printf("error is %s\n", strerror(errno));
    } else
    {
        printf("success\n");
        struct person man;
        memset(&man, 0 ...

Continue reading

Linux command history

[root@linux ~]# history [n]
[root@linux ~]# history [-c]
[root@linux ~]# history [-raw] histfiles

Parameters:

-n  :number, meaning ' the n command to list the most recent list ' means!

-c  :All the history in the current shell delete all content

-a  :Will be added into the history currently added instruction in histfiles, if not histfiles, then the ...

Continue reading

virtualenv -- python Virtual Environment

1. Installation pip

 pip install virtualenv

2. Creating a Virtual Environment

virtualenv envfolder(Virtual environment name)

3. Start Virtual Environment

After you create a successful, will generate the corresponding directory files in the current directory.

cd envfolder/

Then start

source ./bin/activate

4.Quit Virtual Environment

   deactivate

Monthly archives

Next year

2016