-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions
90 lines (74 loc) · 1.9 KB
/
functions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/bash
####### PHP #######
function php.set.debug()
{
export XDEBUG_CONFIG="remote_host=192.168.90.12 idekey=PHPSTORM_MTITOV"
#if need to run with specific phpstorm configuration, uncommend following and set appropriate variable
#export PHP_IDE_CONFIG="serverName={SERVER NAME IN PHP STORM}"
}
function php.unset.debug()
{
unset XDEBUG_CONFIG
}
####### END PHP #######
#@todo remove cd and fix problem with creating symlink
function workspace.create()
{
if [ -z "$1" ]
then
echo "Provide workspace name, for example ticket number"
else
rm -rf "~/Documents/workspaces/$1"
cd ~
mkdir -p Documents/workspaces/$1
cd ~/Documents/workspaces/$1
# rm -f ~/Desktop/$1
# cd ~
# ln -s "~/Documents/workspaces/$1/" "$1"
# cd ~/Desktop
# ln -s "~/Documents/workspaces/$1/" "$1"
fi
}
function workspace.list()
{
ls -1 ~/workspaces/
}
function workspace.open()
{
if [ -z "$1" ]
then
echo "Provide workspace name, for example ticket number"
else
cd ~/Documents/workspaces/$1
fi
}
function workspace.delete()
{
if [ -z "$1" ]
then
echo "Provide workspace name, for example ticket number"
else
rm -rf ~/Documents/workspaces/$1
rm ~/$1
fi
}
####### MYSQL #######
function mysql-droptables()
{
echo 'uncoment and check the function code'
# MUSER="username"
# MPASS="password"
# MDB="database"
# HST="10.10.10.*"
# Detect paths
# MYSQL=$(which mysql)
# AWK=$(which awk)
# GREP=$(which grep)
# TABLES=$($MYSQL -h $HST --user=$MUSER --password=$MPASS $MDB -e 'show tables' | $AWK '{ print $1}' | $GREP -v '^Tables' )
# for t in $TABLES
# do
# echo "Deleting $t table from $MDB database..."
# $MYSQL -h $HST --user=$MUSER --password=$MPASS $MDB -e "SET FOREIGN_KEY_CHECKS = 0; drop table $t; SET FOREIGN_KEY_CHECKS = 1;"
# done
}
####### END MYSQL #######