Skip to content

Instantly share code, notes, and snippets.

@alkavan
alkavan / linux_console_commands.sh
Last active August 29, 2023 11:23
All kind of useful Linux commands.
# I book marked some sites with useful Linux commands i found.
# then i noticed they were down, so i loaded them via google cache, and copied here.
# source: http://blog.urfix.com/
# source: http://www.pixelbeat.org/cmdline.html
# Enjoy!
# How to run process as background and never die
#
# nohup means: Do not terminate this process even when the stty is cut off.
# > /dev/null means: stdout goes to /dev/null (which is a dummy device that does not record any output).
# Configuration file generated by pwmconfig, changes will be lost
INTERVAL=1
DEVPATH=hwmon0=devices/platform/it87.656
DEVNAME=hwmon0=it8721
FCTEMPS=hwmon0/device/pwm2=hwmon0/device/temp1_input hwmon0/device/pwm3=hwmon0/device/temp2_input
FCFANS=hwmon0/device/pwm2=hwmon0/device/fan1_input hwmon0/device/pwm3=hwmon0/device/fan2_input
MINTEMP=hwmon0/device/pwm2=40 hwmon0/device/pwm3=40
MAXTEMP=hwmon0/device/pwm2=100 hwmon0/device/pwm3=85
MINSTART=hwmon0/device/pwm2=81 hwmon0/device/pwm3=100
MINSTOP=hwmon0/device/pwm2=80 hwmon0/device/pwm3=90
@atErik
atErik / sshd.conf
Last active March 22, 2018 11:16
A comparatively stronger & safer & secured sshd_config for SSH Server
# Created by atErik, tErik.
# Copyright 2011-2015 atErik.
# a4t4erik AT out4look dot co4m, a4t4erik0 AT 4gmail dot co4m
# (Remove all prev & above "4").
# Released under GPL (GNU Public License).
#
#
# 1st created & used on 2011.
# Improved and changed, when necessary.
# 1st released to public under GPL on March 6th, 2015.
@bodqhrohro
bodqhrohro / getcurrenttrack.sh
Last active December 29, 2019 05:52
System monitoring
#!/bin/bash
MAX_LENGTH=30
deadbeef --nowplaying "%t|%a|%b|%e|%l>"|while IFS='|' read -d '>' -a track_params; do
track_name="${track_params[3]}/${track_params[4]}\n🎵 ${track_params[0]}\n👽 ${track_params[1]}\n💿 ${track_params[2]}"
if [[ $track_name = 'nothing\nnothing' ]]; then
track_name=■;
fi
echo -e $track_name
@T4cC0re
T4cC0re / gist:14f34dee4b6f4b6b4211
Created January 24, 2016 07:49
add user to sudoers w/o passwd
echo "`whoami` ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/`whoami`
@T4cC0re
T4cC0re / secureit.sh
Last active January 27, 2018 20:09
Secure SSH access (as root)
#/usr/bin/env bash
# this assumes you have installed your public key and have means to access to the server.
rm -rf /etc/ssh/ssh_host_*
ssh-keygen -A
passwd -d root
sed -i 's/^[# ]*PermitRootLogin [^\r\n\]\+$/PermitRootLogin without-password/gmi' /etc/ssh/sshd_config
sed -i 's/^[# ]*ServerKeyBits [^\r\n]\+$/ServerKeyBits 2048/gmi' /etc/ssh/sshd_config
sed -i 's/^[# ]*PermitEmptyPasswords [^\r\n]\+$/PermitEmptyPasswords no/gmi' /etc/ssh/sshd_config
sed -i 's/^[# ]*PubkeyAuthentication [^\r\n]\+$/PubkeyAuthentication yes/gmi' /etc/ssh/sshd_config
sed -i 's/^[# ]*PasswordAuthentication [^\r\n]\+$/PasswordAuthentication no/gmi' /etc/ssh/sshd_config
@xenithorb
xenithorb / xorg.conf
Last active January 5, 2018 01:21
Current xorg.conf for a 3x 1080p monitor side-by-side setup (with the left most 90^o rotated)
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 364.15 (mockbuild@) Fri Apr 8 12:50:17 CEST 2016
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "0"
EndSection
@franciscocpg
franciscocpg / generate.sh
Last active January 27, 2018 20:08
Self signed certificate
set -e
while [[ -z "$domain" ]]; do
echo -n "Domain:"
read domain
done
openssl genrsa -des3 -passout pass:x -out "$domain.pass.key" 2048
openssl rsa -passin pass:x -in "$domain.pass.key" -out "$domain.key"
rm "$domain.pass.key"
openssl req -new -key "$domain.key" -out "$domain.crt"
@ansulev
ansulev / install-arch-linux-on-btrfs-subvolume-inside-luks
Last active June 30, 2024 03:07
Install Arch Linux with full encrypted btrfs subvolume inside luks
# Install Arch Linux with full encrypted btrfs subvolume inside luks
# Hardware: BIOS system, Intel GPU, Nvidia Optimus, Toshiba SSD, Wifi
# Please adjust for your needs.
# filename: install-arch-linux-on-btrfs-subvolume-inside-luks.txt
# The official guide: https://wiki.archlinux.org/index.php/Installation_Guide
# Download the archiso image from https://www.archlinux.org/download/
# Copy to a usb-drive
dd bs=4M if=archlinux.iso of=/dev/sdx status=progress oflag=sync # on linux
@2E0PGS
2E0PGS / gigabyte-usb3-fix.md
Last active May 2, 2024 11:56
GIGABYTE GA-970A-DS3 USB3 fix for Ubuntu x64

Ok so for anyone with "GIGABYTE GA-970A-DS3" I have done alot of testing and research. The best config I found to get USB3 working is this:

Edit Grub config:

sudo nano /etc/default/grub

Edit the line that looks like this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"