Skip to main content

Posts

Showing posts from February, 2019

i3 brightness script

cd 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.: EOF exit 1 fi # Gather information backlight_dir='/sys/class/backlight' 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 fi device_dir="${ba

get window class for i3

#! /bin/sh # Source: https://faq.i3wm.org/question/2172/how-do-i-find-the-criteria-for-use-with-i3-config-commands-like-for_window-eg-to-force-splashscreens-and-dialogs-to-show-in-floating-mode.1.html # 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: https://bugs.freedesktop.org/show_bug.cgi?id=66807 PROGNAME= ` basename " $0 " ` # Check for xwininfo and xprop for cmd in xwininfo xprop ; do if ! which $cmd > /dev/null 2>&1 ; then echo " $PROGNAME : $cmd : command not found " >&2 exit 1 fi done match_int= ' [0-9][0-9]* ' match_string= ' ".*" ' match_qstri

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_secure_installation mysql -u root -p CREATE USER 'username'@'localhost' IDENTIFIED BY 'some_pass'; GRANT ALL PRIVILEGES ON mydb.* TO 'username'@'localhost'; FLUSH PRIVILEGES; 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) pipes echo "something" > file #overwrites echo "something" >> file # appends text

proc limit

[host@user ~]$ ps --no-headers -Leo user | sort | uniq -c /etc/security/limits.conf * soft nproc 400 * hard nproc 200 To set ulimit value on a parameter use the below command. # ulimit -p [new_value] For the ulimits to persists across reboots we need to set the ulimit values in the configuration file /etc/security/limits.conf . Settings in /etc/security/limits.conf take the following form: # vi /etc/security/limits.conf #[domain] [type] [item] [value] * - core [value] * - data [value] * - priority [value] * - fsize [value] * soft sigpending [value] eg:57344 * hard sigpending [value] eg:57444 * - memlock [value] * - nofile [value] eg:1024 * - msgqueue [value] eg:819200 * - locks