Skip to content

Instantly share code, notes, and snippets.

View smaknsk's full-sized avatar

Aleksandr Sobolevskii smaknsk

View GitHub Profile
mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
systemctl start mysqld
mysqladmin password 'root'
mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION"
mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'root' WITH GRANT OPTION"
mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'127.0.0.1' IDENTIFIED BY 'root' WITH GRANT OPTION"
mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'::1' IDENTIFIED BY 'root' WITH GRANT OPTION"
@smaknsk
smaknsk / Git branch in terminal
Created September 26, 2019 10:24
Git branch in terminal
# Git branch in prompt.
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "("${ref#refs/heads/}")"
}
PS1="\[\033[00;32m\]\u@\h\[\033[00m\]:\[\033[00;33m\]\w\[\033[00;31m\]\$(parse_git_branch)\[\033[00m\]\$ "
EDITOR="mcedit"
Cubox 1st gen
http://web.archive.org/web/20120405154814/http://www.solid-run.com/products/cubox
1. dhcpcd v7 broken, copy dhclient on microsd
https://archlinuxarm.org/packages/armv7h/dhclient
2. Install dhclient and configure
pacman -U dhclient-4.4.1-4-armv7h.pkg.tar.xz
cp /etc/netctl/examples/ethernet-dhcp /etc/netctl/eth0
replace dhcpcd to dhclient in /etc/netctl/eth0
@smaknsk
smaknsk / aurinstall
Last active October 29, 2015 15:26
function aurinstall() {
local PKGNAME
echo "install = $@"
return
for PKGNAME in $@; do
echo "Installing ${PKGNAME}..."
local PKGDEST=/tmp/makepkg_${PKGNAME}
/usr/bin/mkdir ${PKGDEST}
cd ${PKGDEST}
/usr/bin/curl -s https://aur.archlinux.org/packages/${PKGNAME:0:2}/${PKGNAME}/${PKGNAME}.tar.gz | /usr/bin/tar -zx
#!/bin/bash
#
# ArchLinux Apache Configure
#
#
# Development server packages
#
pacman -S --noconfirm --needed apache php-apache
#!/bin/bash
#
# Provision for Vagrant box ArchLinux
#
# Insert to Vagrantfile:
# config.vm.provision "shell", path: "https://gist.github.com/smaknsk/8165875/raw"
#
#
# Run nginx, httpd, php-fpm as user: