Skip to main content


Showing posts from February, 2019

i3 brightness script

mkdir scripts
touch scripts/bright

nano/leafpad/gedit  bright
#!/usr/bin/env bash
set -e
if [ "$#" -eq 0 ]; then
cat <<-eof p="">Usage: $0 [command]
Increase or decrease screen brightness at hardware level by steps of 10% of
max, as determined by the values under /sys/class/backlight/**. Limit values
to the range of 0 to max_brightness.

up | Increase brightness by 10%
down | Decrease brightness by 10%
current | Report current brightness

This script needs root access - sudo is an option, but you may also consider
allowing your user to run the script without a password prompt e.g.:
exit 1
# Gather information
device_dir=$(ls "${backlight_dir}" | head -n 1)
if [ -z "$device_dir" ]; then
echo 'No backlight hardware is listed in /sys/class/backlight! Quitting.'
exit 1

get window class for i3

#!/bin/sh# Source: i3-get-window-criteria - Get criteria for use with i3 config commands# To use, run this script, then click on a window.# Output is in the format: [== ...]# Known problem: when WM_NAME is used as fallback for the 'title=""' criterion,# quotes in "" are not escaped properly. This is a problem with the output of `xprop`,# reported upstream:

xterm new config

! special
*.foreground:   #e4e4e4
*.background:   #262626
*.cursorColor:  #e4e4e4

! black
*.color0:       #fafafa
*.color8:       #868686

! red
*.color1:       #3e3a94
*.color9:       #3e3a94

! green
*.color2:       #534dc0
*.color10:      #534dc0

! yellow
*.color3:       #8081ff
*.color11:      #8081ff

! blue
*.color4:       #80b1ff
*.color12:      #80b1ff

! magenta
*.color5:       #a246d1
*.color13:      #a246d1

! cyan
*.color6:       #bc7190
*.color14:      #bc7190

! white
*.color7:       #000000
*.color15:      #000000
XTerm.vt100.metaSendsEscape: true
XTerm.vt100.saveLines: 4096
XTerm.vt100.scrollBar: true
XTerm.vt100.scrollbar.width: 4
XTerm.vt100.faceName: DejaVu Sans Mono:size=10:antialias=false
XTerm.vt100.font: 7x13
XTerm*selectToClipboard: true
XTerm.vt100.translations: #override \n\
    Ctrl M: maximize() \n\
    Ctrl R: restore()  \n\
    Ctrl Shift C: copy-selection(CLIPBOARD) \n\
    Ctrl Shift V: insert-selection(CLIPBOARD)


mysql mariadb

sudo pacman -S mariadb
sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
#optional#sudo systemctl enable mariadb.service
sudo systemctl start mariadb.service

mysql -u root -p

CREATE USER 'username'@'localhost' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON mydb.* TO 'username'@'localhost';

create database moo;
show databases;
use moo;
show tables;
create table animals( num int(2), name varchar(10), location varchar(10), primary key(num));
describe animals;
insert into animals ( num , name,location) values(1,'tiger','mountains');
select * from animals;
drop table animals;

linux cmd

ctrl+a = begining of terminal line
ctrl+e = end of line
ctrl+r= reverse search
ctrl+c= cancel

ss=  socket statistics alt to  depreciated netstat

ps channels STDIN,STDOUT,STDERR (0,1,2)


echo "something" > file #overwrites
echo "something" >> file # appends text