Skip to content

Instantly share code, notes, and snippets.

View t0rik's full-sized avatar
🏠
Working from home

Vadym t0rik

🏠
Working from home
View GitHub Profile
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
user = mysql
@t0rik
t0rik / zabbix_mikrotik_template.xml
Last active October 2, 2019 06:39
zabbix mikrotik SNMP template
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>3.0</version>
<date>2016-08-19T12:43:36Z</date>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<templates>
@t0rik
t0rik / ajaxtest.html
Last active October 2, 2019 12:25
html ajax api fetch json test
<!DOCTYPE html>
<html lang="en">
<html>
<head>
<meta charset="utf-8">
<title>Ajax test</title>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0">
<!-- css -->
<meta name="description" content="" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
@t0rik
t0rik / drupal_8_twig_cheatsheet.md
Created November 20, 2020 13:42 — forked from raphaellarrinaga/drupal_8_twig_cheatsheet.md
[Drupal 8 Twig cheatsheet] #tags: drupal8, twig, cheatsheet

Drupal 8 Twig cheatsheet

Getting Drupal 8 field values in Twig

Image path: {{ file_url(content.field_name['#items'].entity.uri.value) }}

Image title text: {{ node.field_name.title }}

Entity Reference path: {{ content.field_tags[0]['#url'] }}

@t0rik
t0rik / .htaccess
Created April 13, 2021 11:32 — forked from alexsasharegan/.htaccess
Apache Config for React Router
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule . /index.html [L]
@t0rik
t0rik / create_user.yml
Last active July 27, 2021 08:35
Create user playbook
---
- name: Linux Create User and Upload User Public keys
hosts: test
#remote_user: xxxx
#sudo: yes
vars:
user_1: devuser
tasks:
- name: Make sure we have a 'wheel' group
group:
@t0rik
t0rik / nginx.yml
Created July 27, 2021 08:49
nginx playbook
---
- hosts: all
tasks:
- name: ensure nginx is at the latest version
apt: name=nginx state=latest
become: yes
- name: start nginx
service:
name: nginx
state: started
@t0rik
t0rik / Drupal 8 on VestaCP.md
Created July 26, 2022 05:59 — forked from m4tlch/Drupal 8 on VestaCP.md
Templates for Drupal 8 on VestaCP

Each file should be put in /usr/local/vesta/data/templates/web/apache2

Then, when you edit your domain/site, you can change the web template to Drupal8 and just upload your whole project into public_html

@t0rik
t0rik / TransactionSeeder.php
Last active September 29, 2022 10:27
Import csv file to laravel
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use App\Models\Transaction;
class TransactionSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
@t0rik
t0rik / script.sh
Created March 3, 2023 15:26 — forked from vielhuber/script.sh
PostgreSQL: Backup and restore export import pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux