Skip to content

Instantly share code, notes, and snippets.

@core01
core01 / del_vpn_user.sh
Last active June 18, 2020 07:35
delete ipsec vpn user
#!/bin/sh
#
# Script to delete an VPN user for both IPsec/L2TP and Cisco IPsec
#
# Copyright (C) 2018-2020 Lin Song <linsongui@gmail.com>
#
# This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
# Unported License: http://creativecommons.org/licenses/by-sa/3.0/
#
# Attribution required: please include my name in any derivative and let me
@core01
core01 / add_user.sh
Last active June 18, 2020 07:26
add user to ipsec vpn
#!/bin/sh
#
# Script to add/update an VPN user for both IPsec/L2TP and Cisco IPsec
#
# Copyright (C) 2018-2020 Lin Song <linsongui@gmail.com>
#
# This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
# Unported License: http://creativecommons.org/licenses/by-sa/3.0/
#
# Attribution required: please include my name in any derivative and let me
=== Verbose logging started: 25.11.2018 10:32:46 Build type: SHIP UNICODE 5.00.10011.00 Calling process: C:\Windows\System32\msiexec.exe ===
MSI (c) (2C:38) [10:32:47:027]: Font created. Charset: Req=204, Ret=204, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg
MSI (c) (2C:38) [10:32:47:028]: Font created. Charset: Req=204, Ret=204, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg
MSI (c) (2C:7C) [10:32:47:082]: Resetting cached policy values
MSI (c) (2C:7C) [10:32:47:082]: Machine policy value 'Debug' is 0
MSI (c) (2C:7C) [10:32:47:082]: ******* RunEngine:
******* Product: C:\Users\core01\Downloads\elasticsearch-6.5.1.msi
******* Action:
<template>
<form class="login-form">
<div class="field">
<label class="label">Email</label>
<div class="control">
<input class="input" type="text" placeholder="Email" v-model="email">
</div>
</div>
<div class="field">
import { defaults, get } from 'lodash'
import axios from 'axios'
import store from '../store/store'
import def from './default'
export const connection = (options = {}) => {
if (store.getters.getToken) {
def.headers = {Authorization: store.getters.getToken}
}
const instance = axios.create(defaults(def, options))
@core01
core01 / pdoFetch.php
Last active March 10, 2016 15:17
Пример кода с pdoFetch
<?
public function getSelfCost($ingredientId, $stockId)
{
$pdo = $this->modx->getService('pdoFetch');
$pdo->setConfig(array(
'class' => 'msInventoryIngredientInfo',
'innerJoin' => array(
'msInventoryIngredient' => array(
'class' => 'msInventoryIngredient',
'on' => 'msInventoryIngredient.invent_id = msInventoryIngredientInfo.invent_id'
@core01
core01 / query.sql
Created February 5, 2016 10:20
SQL query to drop current primary key and add one new
ALTER TABLE `modx_ms2_ingredient_remains` DROP PRIMARY KEY;
ALTER TABLE `modx_ms2_ingredient_remains` ADD `id` int(10) unsigned AUTO_INCREMENT primary key;
@core01
core01 / addsite.sh
Created January 30, 2016 23:08
Ubuntu 10.04 (nginx + php5-fpm): Install MODX 2.2 including user, virtual host, database
#!/bin/bash
# MySQL root password
ROOTPASS='password'
TIMEZONE='Europe/Moscow'
MYSQLPASS=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12`
SFTPPASS=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12`
PASSWORD=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12`
##############
@core01
core01 / addplace.sh
Created January 30, 2016 23:06
Script for add non MODX site
#!/bin/bash
# MySQL root password
ROOTPASS='password'
TIMEZONE='Europe/Moscow'
MYSQLPASS=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12`
SFTPPASS=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12`
PASSWORD=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12`
##############
@core01
core01 / gist:3898e314d48ae9e0ad49
Created November 27, 2015 20:31 — forked from karmazzin/gist:5690763
Настройка php-fpm, nginx на vps
В этом мануале мы попробуем настроить связку nginx и php-fpm, так чтобы она могла работать на бесплатном тарифе. В уме мы держим, что в результате на этом сервере будет бежать drupal (весьма требовательный к ресурсам движок), но настройки подойдут и для массы других cms.
Надо сказать, что львиная доля этого how-to — это перепечатка (естественно с согласия авторов) статьи на [url=http://nixclub.pro/node/31]nixclub.pro[/url] Евгения Верещагина и Александра Кубашина, поскольку они написали, ну буквально про нас и написали хорошо.
Перед началом рекомендуем минимально настроить сервер с помощью [url=http://forum.serverscamp.com/viewtopic.php?f=14&t=202]этого[/url] руководства.
Далее текст перепечатки:
0.0 Введение (или зачем эта статья)