Skip to content

Instantly share code, notes, and snippets.

@zenithtekla
Last active July 11, 2017 17:59
Show Gist options
  • Save zenithtekla/439bd295e53bc05f2ade6a0bea7c5547 to your computer and use it in GitHub Desktop.
Save zenithtekla/439bd295e53bc05f2ade6a0bea7c5547 to your computer and use it in GitHub Desktop.
ESP21 settings
# OS
# ===========
.DS_Store
ehthumbs.db
Icon?
Thumbs.db
# TERMINAL, TERMINUS
# ===========
*.stackdump
# Node and related ecosystem
# ==========================
.nodemonignore
.sass-cache/
node_modules/
public/lib/
config/db/
app/tests/coverage/
.bower-*/
.idea/
coverage/
# MEAN.js app and assets
# ======================
public/dist/
uploads
modules/users/client/img/profile/uploads
config/env/local.js
*.pem
# Ignoring MEAN.JS's gh-pages branch for documenation
_site/
# General
# =======
*.log
*.csv
*.dat
*.out
*.pid
*.gz
*.tmp
*.bak
*.swp
logs/
build/
# Sublime editor
# ==============
.sublime-project
*.sublime-project
*.sublime-workspace
# Eclipse project files
# =====================
.project
.settings/
.*.md.html
.metadata
*~.nib
local.properties
# IntelliJ
# ========
*.iml
# Cloud9 IDE
# =========
.c9/
data/
mongod
# Visual Studio
# =========
*.suo
*.ntvs*
*.njsproj
*.sln
http://www.classicshell.net/forum/viewtopic.php?f=7&t=3092
Env_Variables:
- User variables:
C:\Ruby23-x64\bin;C:\Users\PhucTran\AppData\Roaming\npm;C:\Program Files\nodejs;C:\Python27;C:\MongoDB\Server\3.2\bin;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\PhucTran\AppData\Local\.meteor\;C:\Program Files\MySQL\MySQL Server 5.5\bin\
- System variables:
Path>>
C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\PHP\v5.6;C:\Windows\system32\inetsrv;C:\Program Files\PHP\v7.0;C:\Program Files\Internet Explorer;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Dell\SysMgt\oma\bin;C:\Program Files\Dell\SysMgt\shared\bin;D:\Program Files\Microsoft SQL Server\120\DTS\Binn\;D:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;D:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;D:\Program Files\Microsoft SQL Server\120\Tools\Binn\;D:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;D:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;D:\Program Files\Microsoft SQL Server\110\DTS\Binn\;D:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;D:\Program Files\Microsoft SQL Server\110\Tools\Binn\;D:\Program Files (x86)\Microsoft SQL Server\110\To;C:\Program Files\MySQL\MySQL Server 5.5\bin;D:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\;D:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files\nodejs\;%USERPROFILE%\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;D:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\nodejs;C:\Python27;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Users\PhucTran\AppData\Roaming\npm\;C:\Users\PhucTran\AppData\Local\Programs\Git\cmd;C:\Program Files\Redis\;C:\MongoDB\Server\3.2\bin
# put this file ./ssh
#activehacker account
Host github.com-zenithtekla
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_zenithtekla
#jexchan account
Host github.com-zetekla
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_zetekla
-=========== INTELLIJ =====-
"C:\Program Files\Git\bin\sh.exe" -login -i
-=========== MSDOS ========-
DELETE a folder
http://www.sevenforums.com/tutorials/55721-folder-delete-command-prompt.html
RD /S /Q "Full Path of Folder"
RD /S /Q "C:\Users\UserName\Desktop\Folder"
-=========== NODEjs =======-
killall node
taskkill /im node.exe
taskkill /f /im node.exe
-=========== GIT ==========-
ssh-add -l // to verify
eval $(ssh-agent -s)
ssh-add ~/.ssh/id_rsa_zetekla
git config --list // to verify
# use .bashrc and .bash_profile in Windows
https://danlimerick.wordpress.com/2011/06/10/git-for-windows-tip-setting-shell-aliases-with-msysgit/
https://stackoverflow.com/questions/25736579/why-or-how-do-bashrc-bash-profile-files-work-for-windows
https://www.moncefbelyamani.com/create-aliases-in-bash-profile-to-assign-shortcuts-for-common-terminal-commands/
-=========== CHROME =======-
chrome:flags/#automatic-tab-discarding
chrome:flags
-=========== Sequelize retrieve models =======-
sequelize-auto -o './models' -d mantis_live_dev -h localhost -u root -p 3306 -x ***** -e mysql
( ***** : password, requires sequelize-auto package)
The best way to actually know what application is listening to which interface and on what port is to use netstat
netstat
netstat -tlnp
-=========== Cloud9 SDK ============-
start c9 at jump to user\AppData\Local\Programs\Git\c9projects, shorthand with ./c9proj
cd c9sdk/
node server.js -p 8080 -a: -w /c9projects/
start c9 at Node at NodeMySQL, shorhand with ./c9www
cd c9sdk/
node server.js -p 8080 -a: -w /C/inetpub/wwwroot/development/phuc_NodeJS_MySQL/NodeMySQL/
-=========== MYSQL terminal ============-
Accessing MYSQL from Git or local C9 SDK: at user~, use:
./mysql OR mysql -u root -p
then type password. some common statements:
show databases
use <database-name>
show tables
desc <table-name>
-=========== ENABLE DISTRACTION-FREE ENV ============-
-=========== ENABLE DISTRACTION-FREE ENV ============-
Hide Server Manager on startup (user-end):
http://windowsitpro.com/windows-server-2012/stop-server-manager-automatically-launching
Thunderbird (dealing with pre-installed enforced on ServerRT):
- login with my anonymous email acc.
settings my email acc on Thunderbird:
- install Firetray adds-on for Thunderbird within itself and set to minimize on startup and disable all notifications.
- set to NOT receive email >1kB and automatically delete any email after 1 day.
MS Outlook (workstation):
- workstation: auto-fire on startup, auto-collect emails, tray icon when minimize, silence to any notifications.
-=========== TERMINAL ============-
linux exec (& to start on background)
exec 'C:/Program Files/Robomongo 0.9.0-RC9/Robomongo.exe' &
sh -c 'path/to/file'
batch windows (start/max to display maximum)
start "" "C:\Python27\python.exe"
start chrome http://localhost:1337/
subl .
https://scotch.io/tutorials/open-sublime-text-from-the-command-line-using-subl-exe-windows
METEOR
Go to this directory - C:\Users[your username]\AppData\Local\.meteor
You should see a meteor.bat file there. Create a new file called "meteor" (without any extension and ""). Open it with notepad and paste the following:
#!/bin/sh
cmd //c "$0.bat" "$@"
save the file and now run git bash. You should be able to use meteor command in git bash.
-========== EXTRA ===============-
umzug lib is a framework agnostic Migration tool for Node.JS
http://stackoverflow.com/questions/15977038/how-do-i-start-mintty-and-run-a-script-file
mintty.exe --exec '/bin/test.sh'
http://askubuntu.com/questions/137776/starting-multiple-applications-using-a-shell-script
http://unix.stackexchange.com/questions/152310/how-to-correctly-start-an-application-from-a-shell
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html#toc8
. something allows you to run the script from any location, ./something requires you to be in the directory the file is stored in
http://stackoverflow.com/a/13112324
npm install pug --save
npm install grunt-contrib-sass --save-dev
#optional-> npm install -g ruby-sass
#important
ruby -v
gem install sass
MONGO_SEED=true grunt prod
grunt test:server
grunt prod
IIS website conf on Windows server 2012
https://www.youtube.com/watch?v=BYwOMuBDhPU
JetBrains: http://albertlee.azurewebsites.net/using-mongo-plugin-with-webstorm/
echo 'mongod --directoryperdb --dbpath C:/MongoDB/Server/3.2/data/db --logpath C:/MongoDB/Server/3.2/log/mongodb.log --logappend' > mongo-start
echo 'mongod --directoryperdb --dbpath C:/MongoDB/Server/3.2/data/db --logpath C:/MongoDB/Server/3.2/log/mongodb.log --logappend --nojournal --rest --smallfiles' > mongod
chmod a+x mongod
chmod 777 simple_bash.sh // give it root right (skip 'sudo', another workaround is to inject a line 'sudo -i' into simple_bash.sh, provided that chmod 777 is ignored)
chmod a-x mongo-start
./mongo-start
mongod -dbpath C:\Users\derekbanas\meantut\sampsite\data
msiexec.exe /q /i mongodb-win32-x86_64-2008plus-ssl-3.2.7-signed.msi ^
INSTALLLOCATION="c:\inetpub\wwwroot\development\phuc_NodeJS_MySQL\MEAN\emiApp\data" ^
ADDLOCAL="all"
msiexec.exe /q /i mongodb-win32-x86_64-2008plus-ssl-3.2.7-signed.msi INSTALLLOCATION="c:\inetpub\wwwroot\development\phuc_NodeJS_MySQL\MEAN\emiApp\data" ADDLOCAL="all"
Cloud9:
echo "--== Setting Up MongoDB in 'workspace/data'==--"
mkdir data
echo "--== create lunch MongoDB script 'workspace/mongod' https://docs.c9.io/docs/setting-up-mongodb ==--"
echo 'mongod --bind_ip=$IP --dbpath=data --nojournal --rest --smallfiles "$@"' > mongod
chmod a+x mongod
Source:https://gist.github.com/ibitlab/c0fc8139031ccc1878e4
run with following command:
./mongod
________________________________
same way you started it in the first place:
$> mongod --bind_ip=$IP --nojournal
or if you want it to detach from your terminal (instead of making you open a new one)
$> mongod --bind_ip=$IP --nojournal &>/dev/null &
echo 'mongod --port 27017 --dbpath=./data --nojournal' > mongod
chmod a+x mongod
Some extra refs:
https://hackpad.com/ep/pad/static/gbrHvgEyIdr
https://hackpad.com/ep/pad/static/ytpdT4G7ZUp
Solving unexpected DB shutdown
1. delete mongod.lock
I solved this by executing C:\mongodb\bin\mongod.exe --repair first. Then when I ran MongoDB again by C:\mongodb\bin\mongod.exe, it successfully started.
---
stages:
- name: Build
inputs:
- type: git
branch: master
triggers:
- type: commit
jobs:
- name: meanjs-build
type: builder
artifact_dir: ./
build_type: grunt
script: |-
#!/bin/bash
# Install RVM, Ruby, and SASS
# Needed when running grunt build
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -sSL https://get.rvm.io | bash -s stable --ruby --gems=sass
# Start RVM
source /home/jenkins/.rvm/scripts/rvm
# Build MEANJS
npm install
grunt build
- name: Deploy
inputs:
- type: job
stage: Build
job: meanjs-build
jobs:
- name: Deploy
type: deployer
target:
url: ${CF_TARGET_URL}
organization: ${CF_ORGANIZATION}
space: ${CF_SPACE}
application: ${CF_APP}
script: |-
#!/bin/bash
cf push
# view logs
#cf logs "${CF_APP}" --recent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment