Giter VIP home page Giter VIP logo

helpful_programs's Introduction

Helpful Programs

This Repository contains some random useful code to help reduce redundant tasks.

Git Push/Puller Template

Git Pusher & Puller template was created to reduce the need to constantly enter your username and password whenever pushing to github when connected over ssh to server.

Change the username with your username for your github email:

Change the expect line with your github account username:

expect "Password for 'https://[email protected]@github.com': "

Change the password to your password for your github account.

send "1234PASSWORD\r"

In order for this script to work/run, you need to make this file executable. This can be done by changing the read, write, execut file permissions. chmod changes file permissions. 7 represents read, write, executable abilities, which is needed to work. In order to edit the file, chmod 777, then make the necessary changes then chmod back to 555. 5 represents read and execut abilites without write abilties. More about File Permissions at the end.

$ chmod 777 git_push_template.sh

Git git_pusher_args.sh

Pusher.sh was created and the idea to quickly add, commit and push. To use first check the execution abilities of the file, the file needs to be executable to work. Run the following command:

$ ls -l pusher.sh

If the output contains an 'x', that means it can be executed. To execute and pass the arguments (message):

$ ./pusher package update

"Package" and "update" are passed as arguments and can be thought of as the portion of the commit that is sent (git commit -m "package update"). More arguments can be passed provided the variables are defined and added to together to support the concatenation of the strings.

SSH Template

SSH Template was created to reduce the constant need to constantly enter your ssh link and password.

Change the ssh link, to the link you want to connect to:

spawn ssh "\ENTER SSH LINK HERE"

Change the expect statement to what your ssh typically replies with by asking your password:

expect "\ENTER THE STRING THAT WILL COME TO ENTER PASSWORD"  # i.e. "password: "

Change the password you want to send to automatically have entered for you:

send "\PUT PASSWORD HERE\r"

In order for this script to work/run, you need to make this file executable. This can be done by changing the read, write, execut file permissions. chmod changes file permissions. 7 represents read, write, executable abilities, which is needed to work. In order to edit the file, chmod 777, then make the necessary changes then chmod back to 555. 5 represents read and execut abilites without write abilties. More about File Permissions at the end.

$ chmod 777 sshing_template.sh

Chmod - File Permission Commands

  • First number = Owner File Permissions
  • Second number = Group File Permissions
  • Third number = Other File Permissions

Example: The Owner has Read, Write, Execute permissions, everyone else (Group, Other) can only Read and Execute(read only for everyone else):

$ chmod 775 filename.extension
  1. No Permissions
  2. Execute
  3. Write
  4. Write and Execute
  5. Read
  6. Read and Execute
  7. Read and Write
  8. Read, Write, Execute

Example: Type "ls -l" into command line, this is what you will get:

-rwxrwxrwx 1 johnny_appleseed staff  148  May 4 01:12 testfile.sh
  • Directory: d
  • Read: r
  • Write: w
  • Execute: x

Example: The first letter indicates it is a directory. The next 3 letters are for you (the owner) you have read, write, exectue abilites. Group and Others only have read and execute abilites, no writing (no editing the file).

drwxr-xr-x

helpful_programs's People

Contributors

ronmantech avatar

Watchers

 avatar  avatar

Forkers

marwahaha

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.