Skip to content

Instantly share code, notes, and snippets.

View nexusstar's full-sized avatar
🏔️
Vincit qui se vincit

Petar Nikov nexusstar

🏔️
Vincit qui se vincit
View GitHub Profile

Atom settigs

Sync Settings: Upload

Ctrl+Alt+U Download remote configuration

Sync Settings: Download

Ctrl+Alt+D

function themename_menu_link(&$variables) {
$element = $variables['element'];
$sub_menu = '';
$element['#attributes']['data-menu-parent'] = $element['#original_link']['menu_name'] . '-' . $element['#original_link']['depth'];
if ($element['#below']) {
$sub_menu = drupal_render($element['#below']);
}
#!/bin/bash
# A shell script to delete / drop all tables from MySQL database.
# Usage: ./script user password dbnane
# Usage: ./script user password dbnane server-ip
# Usage: ./script user password dbnane mysql.nixcraft.in
# -------------------------------------------------------------------------
# Copyright (c) 2008 nixCraft project <http://www.cyberciti.biz/fb/>
# This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
#!/usr/bin/env python3
"""
Detects and interactively deactivates duplicate Apt source entries.
Usage: python3 apt-remove-duplicate-source-entries.py
"""
from __future__ import print_function
import aptsources.sourceslist
@nexusstar
nexusstar / .spacemacs
Last active December 29, 2016 14:00
Spacemacs dotfile Windows configuration
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@nexusstar
nexusstar / settings.json
Created February 19, 2018 19:57
Visual Studio Code user settings
{
"editor.fontSize": 15,
"vim.leader": "\\",
"vim.enableNeovim": true,
"vim.neovimPath": "C:\\Program Files\\Neovim\\bin\\nvim.exe",
"vim.easymotion": true,
"vim.surround": true,
"vim.scroll": 20,
"vim.visualstar": true,
"vim.statusBarColorControl": true,
sudo ln -s /mnt/c/Neovim/bin/win32yank.exe /usr/bin/win32yank
@nexusstar
nexusstar / getpid.md
Last active April 30, 2018 12:25
Get PID and Image Name Windows

Get PID and Image Name

Use only one command:

for /f "tokens=5" %a in ('netstat -aon ^| findstr 9000') do tasklist /FI "PID eq %a"

where 9000 should be replaced by your port number.

The output will contain something like this:

@nexusstar
nexusstar / mariadb.md
Last active June 22, 2018 08:11
MariaDB with unix_socket and whithout

Default install:

MariaDB [(none)]> SELECT host, user, password, plugin FROM mysql.user LIMIT 0,1;
+-----------+------+----------+-------------+
| host      | user | password | plugin      |
+-----------+------+----------+-------------+
| localhost | root |          | unix_socket |
+-----------+------+----------+-------------+

Ok folks, I ran into this problem this weekend when my OpenStack environment crashed. Another post about that coming soon on how to recover.

I found a solution that worked for me with a SQL Server instance running under the Ver 15.1 Distrib 10.1.21-MariaDB with Fedora 25 Server as the host. Do not listen to all the other posts that say your database is corrupted if you completely copied your old mariadb-server's /var/lib/mysql directory and the database you are copying is not already corrupted. This process is based on a system where the OS became corrupted but its files were still accessible.

Here are the steps I followed.

Make sure that you have completely uninstalled any current versions of SQL only on the NEW server. Also, make sure ALL mysql-server or mariadb-server processes on the NEW AND OLD servers have been halted by running: