m4rc1no5/tools

Some PHP and bash tools

Installs: 513

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 0

Open Issues: 0

Language:Shell

dev-master 2015-12-11 08:01 UTC

This package is not auto-updated.

Last update: 2024-12-21 19:52:53 UTC


README

Total Downloads

This project contains useful tools to improve my work. :)

Documentation

Table of contents

  1. Installation
  2. Add ssh key to remote linux machine
  3. Add virtual host in Apache
  4. Add virtual host in Nginx
  5. PHP Convert String

Installation

This tools are available at packagist.org, so you can use composer to download this library and all dependencies.

(add to require section in your composer.json file)

    {
        "require": {
            "m4rc1no5/tools": "dev-master"
        }
    }

Add ssh key to remote linux machine

This script send and add your public SSH Key to Remote Server.

###Example###

bash/AddSshKey/addSshKey.sh marceen 123.123.123.123 222

variables:

  • marceen - username
  • 123.123.123.123 - hostname
  • 222 - port

If remote server (or your machine) doesn't have ~/.ssh folder You can create it by command:

ssh-keygen -t rsa

Add Virtual Host in Apache

This script creates localhost website folder and adds virtual domain with sufix .lh

###Remember###

Before run this script You must create config.sh file from config.sh.default! This file is in folder: bash/AddVirtualHostApache/

###Example###

Run this command

sudo bash/AddVirtualHostApache/addVirtualHostApache.sh test

will create local domain test.lh.

After this script You can enter browser and write adress test,lh and You will see "hello test!" on screen. :)

Add Virtual Host in Nginx

This script creates localhost website folder and adds virtual domain with sufix .lh

###Remember###

Before run this script You must create config.sh file from config.sh.default! This file is in folder: bash/AddVirtualHostNginx/

###Example###

Run this command

sudo bash/AddVirtualHostApache/addVirtualHostNginx.sh test

will create local domain test.lh.

After this script You can enter browser and write adress test,lh and You will see "hello test!" on screen. :)

PHP Convert String

Underscore to Camelcase

Convert string from underscore to camelcase

use m4rc1no5_tools\Convert\String\UnderscoreToCamelcase;

$field_name = "this_is_foo_bar";

$camelcase_field_name = UnderscoreToCamelcase::underscoreToCamelcase($field_name); // return thisIsFooBar