Skip to content

Instantly share code, notes, and snippets.

@Alexnder
Alexnder / error.md
Last active August 29, 2015 14:15
node windows npm install mongoose bcrypt

mongoose error

node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
child_process: customFds option is deprecated, use stdio instead.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.t argets(64,5): error MSB8020: The build tools for Visual Studio 2010 (Platform T oolset = 'v100') cannot be found. To build using the v100 build tools, please i nstall Visual Studio 2010 build tools.  Alternatively, you may upgrade to the c urrent Visual Studio tools by selecting the Project menu or right-click the sol ution, and then selecting "Upgrade Solution...". [D:\Projects\node\onlineorgani zer\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
You need set visual studio version if you have not VS 2010. Like this:

npm install mongoose --save --msvs_version=2013

systemLog:
destination: file
path: "C:\\Program Files\\MongoDB 2.6 Standard\\mongodb.log"
logAppend: true
storage:
dbPath: "C:\\Program Files\\MongoDB 2.6 Standard\\data"
journal:
enabled: true
net:
bindIp: 127.0.0.1
Make link from C:\Users\user\.ssh to "C:\Program Files (x86)\Git\.ssh"
mklink /d "C:\Program Files (x86)\Git\.ssh" C:\Users\user\.ssh
@Alexnder
Alexnder / config.md
Last active August 29, 2015 14:18
Console Git Windows Install
Host host.com
HostName host.com
User git
IdentityFile ~/.ssh/id_rsa_host_git

Host host.com
HostName host.com
User ubuntu
IdentityFile ~/.ssh/id_rsa_host
@Alexnder
Alexnder / sshd_config.md
Last active August 29, 2015 14:18
sshd_config

nano /etc/ssh/sshd_config

Config to long live ssh sessions

TCPKeepAlive yes
ClientAliveInterval 60
ClientAliveCountMax 10

Restart

service ssh restart

@Alexnder
Alexnder / squid_conf.md
Last active August 29, 2015 14:18
Squid simple config with cache without auth on debian

install

apt-get install squid3

configure

nano /etc/squid3/squid.conf

config file

http_access allow all
http_port 3128

cache_dir ufs /var/spool/squid3 1024 16 256
@Alexnder
Alexnder / ez_config.md
Last active August 29, 2015 14:19
Ez Publish Кэш

Кэш ini файлов

В файле config.php строка отвечает за проверку настроек ini файлов. По заявкам даёт повышение скорости загрузки страниц в 10% - 15%

define('EZP_INI_FILEMTIME_CHECK', false);

Принудительное истечение срока годности кэша настроек: php bin/php/ezcache.php --clear-id=global_ini

Удаление кэша настроек:

@Alexnder
Alexnder / opt.md
Created April 17, 2015 15:53
Оптимизация изображений

Оптимизация png без потерь

apt-get install pngcrush

for file in *.png ; do pngcrush -reduce -brute -rem alla -rem gAMA -rem cHRM -rem iCCP -rem sRGB "$file" "${file%.png}-crushed.png" && mv "${file%.png}-crushed.png" "$file" ; done

Оптимизация jpg без потерь

apt-get install jpegoptim

jpegoptim *.jpg --strip-all

Старые закладки

chrome://flags/#enhanced-bookmarks-experiment

Старое место аватара при переключении пользователей

Уже не работает

chrome://flags/#enable-new-avatar-menu

Возможно отключает вопрос о недоверенных расширениях

Create dropbox from another user

runas /user:drop /savecred C:\Users\drop\AppData\Roaming\Dropbox\bin\Dropbox.exe