Git Product home page Git Product logo

my_scripts's Introduction

Useful Scripts

Useful general purpose scripts written in Bash or Python

appendText

Description Script gets selected number of lines from one file and append those lines to other file.

Usage: appendText <inputFile> <outputFile> <numberOfLines>

  • inputFile - files where lines should be get from
  • outputFile - files where lines should be appended to
  • outputFile - number of lines from inputFile which should be appended to outputFile Example: appendText input.txt output.txt 2
  • This will copy first 2 lines from input file and will append them to output.txt

application_controller

Description Script which can assure that some application is still working. If application crashes, this script restart it.

Configuration: There are few configuration variables withing application_controller file which should be set up:

  • CHECKINGPERIOD - interval (in seconds) where controller check whether application is working
  • MYEMAIL - email where notification about application crash and restarting should be send (you have to have configured mail app to receive mail notifications)

Usage: application_controller <APPLICATION_NAME>

  • APPLICATION_NAME - name of application which should be checked by controller.

Example: application_controller asterisk

If we select asterisk APPLICATION_NAME then our script will check if asterisk is still working. If asterisk crashes, this controller restarts asterisk.

bkp

Description Doing backup of selected file copying it and appending .bkp to the name. It simplifying working with copies of file when we would like to override it temporary.

Usage: bkp <fileName>

  • fileName - name of file which should be backed up Example: bkp input.txt This will copy input.txt file to input.txt.bkp, so we can test something with input.txt file having it backed up.

change_dependencies_in_debs

Description Appliation allows change dependencies and version of dependencies in .deb file

Usage: change_dependencies_in_debs <debFile.deb>

  • debFile.deb - deb file where we would like to change dependencies

Example: change_dependencies_in_debs skype.deb After invoking above command application will extract skype.deb and will open control file (file where dependencies are saved) in vim editor. You can change those dependencies and save control file. After that, script will create skype.deb.modified.deb containing modified dependencies.

change_text_recursively

Description Changes selected text to another selected text in all files in selected directory recursively.

Usage: change_text_recursively <dir> <replaceeText> <replacerText>

  • dir - directory which will be search (recursively) for files to exchange replaceeText text
  • replaceeText - old text which should be replaced
  • replacerText - new text which should be put instred of replaceeText

Example: change_text_recursively ./myDir before after Execution of this example will search word before in all files being within myDir and replace each occurance of that word with after text.

changeExtension

Description Changes extension of selected files in current directory.

Usage: changeExtension <oldExtension> <newExtension>

  • oldExtension - old extension of files which should be replaced
  • newExtension - new extension which should be assigned to files having oldExtension

Example: changeExtension JPG jpg Invoking of this example will change all files from current directory having extension 'JPG' to files to files having extension 'jpg'

connectSSHFSRemoteResource

Description This script allows connect remote resources (ex. hard drive or directory) through SSHFS protocol.

Configuration: before we will use this script we need to configure them. There are 5 options to configure at the beginning of script code:

  • SERVER_USER - username of remote computer which we would like to use to connect remote resources through SSH
  • SERVER_IP - IP address of remote computer which we would like to connect through SSH
  • SERVER_PATH - path of resources on remote maching which we would like to connect through SSH
  • MOUNT_POINT - local point where remote resources should be connect to
  • OPTIONS - additional options of SSH connection

Usage: connectSSHFSRemoteResource This usage will connect remote resources according to SERVER_USER, SERVER_IP, SERVER_PATH configuration to selected MOUNT_POINT on local computer.

convertDotToPNG

Description TODO

Usage:

Example:

Output of example:

convertHTML5Video

Description TODO

Usage:

Example:

Output of example:

createDebKernelPackeges

Description TODO

Usage:

Example:

Output of example:

createSVNRepository

Description Create SVN repository for selected PROJECT_NAME on local server's directory /home/svn/PROJECT_NAME

Usage: createSVNRepository PROJECT_NAME

  • PROJECT_NAME - name of project and directory of SVN repository

Example: createSVNRepository usefulScripts This creates SVN repository in directory /home/svn/usefulScripts. Repository is ready to check in and check out without authentication.

disable_enable_touchpad

Description TODO

Usage:

Example:

Output of example:

do_action_on_files

Description TODO

Usage:

Example:

Output of example:

do_selected_action_on_files

Description TODO

Usage:

Example:

Output of example:

embedLogoIntoImage

Description TODO

Usage:

Example:

Output of example:

ensureIPAddress

Description TODO

Usage:

Example:

Output of example:

grepSelectedEnvironment

Description TODO

Usage:

Example:

Output of example:

improveImages

Description TODO

Usage:

Example:

Output of example:

installOpenCV

Description TODO

Usage:

Example:

Output of example:

mailing

Description TODO

Usage:

Example:

Output of example:

pdftojpg

Description TODO

Usage:

Example:

Output of example:

popup

Description TODO

Usage:

Example:

Output of example:

prependText

Description TODO

Usage:

Example:

Output of example:

radio

Description TODO

Usage:

Example:

Output of example:

remove_git_dirs

Description TODO

Usage:

Example:

Output of example:

remove_svn_dirs

Description TODO

Usage:

Example:

Output of example:

remove_temporary_files

Description TODO

Usage:

Example:

Output of example:

rst

Description TODO

Usage:

Example:

Output of example:

sendUDPPacketToHostPort

Description TODO

Usage:

Example:

Output of example:

telnetAndRunCommand

Description TODO

Usage:

Example:

Output of example:

UbuCleaner

Description TODO

Usage:

Example:

Output of example:

youtubeSearch

Description TODO

Usage:

Example:

Output of example:

youtubeToMp3

Description TODO

Usage:

Example:

Output of example:

my_scripts's People

Contributors

damziobro avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

sm-learn

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.