cleaned some files up

This commit is contained in:
William Mantly 2017-10-09 14:22:05 -04:00
parent 127a2caac1
commit b81a5a9c2f
7 changed files with 21 additions and 171 deletions

136
nano.save
View File

@ -1,136 +0,0 @@
Color_Off='\e[0m' # Text Reset
# Regular Colors
Black='\e[0;30m' # Black
Red='\e[0;31m' # Red
Green='\e[0;32m' # Green
Yellow='\e[0;33m' # Yellow
Blue='\e[0;34m' # Blue
Purple='\e[0;35m' # Purple
Cyan='\e[0;36m' # Cyan
White='\e[0;37m' # White
# Bold
BBlack='\e[1;30m' # Black
BRed='\e[1;31m' # Red
BGreen='\e[1;32m' # Green
BYellow='\e[1;33m' # Yellow
BBlue='\e[1;34m' # Blue
BPurple='\e[1;35m' # Purple
BCyan='\e[1;36m' # Cyan
BWhite='\e[1;37m' # White
# Underline
UBlack='\e[4;30m' # Black
URed='\e[4;31m' # Red
UGreen='\e[4;32m' # Green
UYellow='\e[4;33m' # Yellow
UBlue='\e[4;34m' # Blue
UPurple='\e[4;35m' # Purple
UCyan='\e[4;36m' # Cyan
UWhite='\e[4;37m' # White
# Background
On_Black='\e[40m' # Black
On_Red='\e[41m' # Red
On_Green='\e[42m' # Green
On_Yellow='\e[43m' # Yellow
On_Blue='\e[44m' # Blue
On_Purple='\e[45m' # Purple
On_Cyan='\e[46m' # Cyan
On_White='\e[47m' # White
# High Intensity
IBlack='\e[0;90m' # Black
IRed='\e[0;91m' # Red
IGreen='\e[0;92m' # Green
IYellow='\e[0;93m' # Yellow
IBlue='\e[0;94m' # Blue
IPurple='\e[0;95m' # Purple
ICyan='\e[0;96m' # Cyan
IWhite='\e[0;97m' # White
# Bold High Intensity
BIBlack='\e[1;90m' # Black
BIRed='\e[1;91m' # Red
BIGreen='\e[1;92m' # Green
BIYellow='\e[1;93m' # Yellow
BIBlue='\e[1;94m' # Blue
BIPurple='\e[1;95m' # Purple
BICyan='\e[1;96m' # Cyan
BIWhite='\e[1;97m' # White
# High Intensity backgrounds
On_IBlack='\e[0;100m' # Black
On_IRed='\e[0;101m' # Red
On_IGreen='\e[0;102m' # Green
On_IYellow='\e[0;103m' # Yellow
On_IBlue='\e[0;104m' # Blue
On_IPurple='\e[0;105m' # Purple
On_ICyan='\e[0;106m' # Cyan
On_IWhite='\e[0;107m' # White
prompt_git() {
local s='';
local branchName='';
# Check if the current directory is in a Git repository.
if [ $(git rev-parse --is-inside-work-tree &>/dev/null; echo "${?}") == '0' ]; then
# check if the current directory is in .git before running git checks
if [ "$(git rev-parse --is-inside-git-dir 2> /dev/null)" == 'false' ]; then
# Ensure the index is up to date.
git update-index --really-refresh -q &>/dev/null;
# Check for uncommitted changes in the index.
if ! $(git diff --quiet --ignore-submodules --cached); then
s+='+';
fi;
# Check for unstaged changes.
if ! $(git diff-files --quiet --ignore-submodules --); then
s+="${On_Red}!${Color_Off}";
fi;
# Check for untracked files.
if [ -n "$(git ls-files --others --exclude-standard)" ]; then
s+="${On_Yellow}?";
fi;
# Check for stashed files.
if $(git rev-parse --verify refs/stash &>/dev/null); then
s+="${On_Green}\$";
fi;
fi;
# Get the short symbolic ref.
# If HEAD isnt a symbolic ref, get the short SHA for the latest commit
# Otherwise, just give up.
branchName="$(git symbolic-ref --quiet --short HEAD 2> /dev/null || \
git rev-parse --short HEAD 2> /dev/null || \
echo '(unknown)')";
# [ -n "${s}" ] && s="${BBlue}[${s}${Color_Off}${BBlue}]";
echo -e "${1}${branchName}${Color_Off}${s}${Color_Off}";
else
return;
fi;
}
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
# PS1='\[\033[01;35m\]\H\[\033[00m\]:\[\033[01;34m\]\w $(prompt_git) \[\033[01;36m\]\d \n'
PS1="\[${BPurple}\]\H\[${BWhite}\]:\[${BBlue}\]\w\$(prompt_git \"\[${BWhite}\] on \[${BPurple}\]\") \[${BCyan}\]\d \n"
PS1+="\[${BYellow}\]\@ \[${BGreen}\]\u\[${Color_Off}\]$ "
export PS1;
[[ $EUID == 0 ]] && PS1='\[\033[01;35m\]\H \[\033[00m\]: \[\033[01;34m\]\w \[\033[01;33m\] \t \[\033[01;36m\]\d\n!\[\033[01;31m\]\u \[\033[00m\]# '
alias open='xdg-open &>/dev/null'
alias c9ide='/home/william/dev/c9sdk/server.js'

View File

@ -1 +1,9 @@
{"image":"25092187","version":10,"lastSnapShotId":"23505298","size":"512mb","max":100,"min":3,"minAvail":3} {
"image":"25092187",
"version":10,
"lastSnapShotId":"23505298",
"size":"512mb",
"max":100,
"min":3,
"minAvail":3
}

3
rx.sh
View File

@ -1,3 +0,0 @@
sudo cgm create all virt
sudo cgm chown all virt $(id -u virt) $(id -g virt)

View File

@ -1,5 +1,14 @@
# Random things not to lose
## Auto start ## Auto start
`@reboot /usr/local/bin/forever start -o /var/log/forver.out.log -e /var/log/sorver.err.log -c "/usr/local/bin/codebox run -p 5000" /workspace/`
http://stackoverflow.com/a/13388741/3140931
```crontab
@reboot /usr/local/bin/forever start -o /var/log/forver.out.log -e /var/log/sorver.err.log -c "/usr/local/bin/codebox run -p 5000" /workspace/`
```
## LXC permission issue
```bash
sudo cgm create all virt
sudo cgm chown all virt $(id -u virt) $(id -g virt)
```

View File

@ -58,4 +58,4 @@ let __do = function(till){
setTimeout(__do, 1500, --till); setTimeout(__do, 1500, --till);
}; };
__do(30) __do(30)

View File

@ -1,20 +0,0 @@
import requests as r
import time
def testAPI(times=100, sleep=2):
errors = 0
for i in range(times):
try:
res = r.post(
'http://127.0.0.1:2000/api/run',
data={'code': 'pwd'},
params={'once': True}
)
if res.status_code != 200: errors += 1
print(i, res.status_code, res.content)
except:
print('caught error')
errors += 1
time.sleep(sleep)
print('errors ', errors, (errors/times)*100)

View File

@ -1,8 +0,0 @@
{
"image": "25092187",
"version": 10,
"size": "512mb",
"max": 100,
"min": 3,
"minAvail": 3
}