Skip to content

Instantly share code, notes, and snippets.

View drmats's full-sized avatar
💭
Discovering mysteries.

Mat. drmats

💭
Discovering mysteries.
View GitHub Profile
@drmats
drmats / color_prompt.sh
Last active August 29, 2015 13:55
Colored shell prompt - red "$" (or "#") sign.
# put this line into .bashrc
export PS1="[\u@\h \W]\[$(tput bold)\]\[$(tput setaf 1)\]\\$ \[$(tput sgr0)\]"
@drmats
drmats / find_chown_chmod.sh
Created December 10, 2014 18:43
Change files/directories own and mod.
# chown all files and directories in the current directory
find . -exec chown -hv user:group '{}' \;
# chmod all files to "rw-------" in the current directory
find . -type f -exec chmod 600 '{}' \;
# chmod all directories to "rwx------" in the current directory
find . -type d -exec chmod 700 '{}' \;
@drmats
drmats / extract_rpm
Created December 10, 2014 18:52
Extract RPM contents
$ rpm2cpio ./some_package.rpm | cpio -idmv
@drmats
drmats / get_system_version
Created January 15, 2015 10:54
Obtain system version.
# issue
$ cat /etc/issue
# through rpm
$ rpm -E %fedora
# fedora/redhat/system/os release
$ cat /etc/redhat-release
$ cat /etc/fedora-release
$ cat /etc/system-release
@drmats
drmats / metacity-theme-3.xml
Created April 17, 2014 14:20
Remove Maximized Windows Titlebar In GNOME Shell
<frame_geometry name="max" has_title="false" title_scale="medium" parent="normal" rounded_top_left="false" rounded_top_right="false">
<distance name="left_width" value="0" />
<distance name="right_width" value="0" />
<distance name="left_titlebar_edge" value="0"/>
<distance name="right_titlebar_edge" value="0"/>
<distance name="title_vertical_pad" value="0"/>
<border name="title_border" left="0" right="0" top="0" bottom="0"/>
<border name="button_border" left="0" right="0" top="0" bottom="0"/>
<distance name="bottom_height" value="0" />
</frame_geometry>
@drmats
drmats / disable.bat
Created September 7, 2015 13:43
disable Win7 MS "telemetry"
REM etc/hosts
REM 127.0.0.1 vortex-win.data.microsoft.com
REM 127.0.0.1 settings-win.data.microsoft.com
wusa /uninstall /kb:3068708 /norestart
wusa /uninstall /kb:3022345 /norestart
wusa /uninstall /kb:3075249 /norestart
wusa /uninstall /kb:3080149 /norestart
@drmats
drmats / custom.login.background.txt
Created January 15, 2017 22:30
Custom Login Background - Windows 7
Start -> gpedit.msc
Computer Configuration\Administrative Templates\System\Logon
"Always use custom login background" -> Enabled
C:\Windows\System32\oobe\info\backgrounds\backgroundDefault.jpg (<= 256kB)
@drmats
drmats / fedora.update.sh
Last active September 21, 2017 14:13
Fedora 24->25->26 update
dnf upgrade --refresh
dnf install dnf-plugin-system-upgrade
dnf system-upgrade download --releasever=26 --best --allowerasing
dnf system-upgrade reboot
dnf clean packages
dnf install NetworkManager-openconnect-gnome openconnect-devel chrome-gnome-shell
@drmats
drmats / set.mtu.bat
Last active November 22, 2017 14:43
Windows MTU
netsh interface ipv4 show subinterfaces
netsh interface ipv4 set subinterface "vpn" mtu=1300 store=persistent
@drmats
drmats / tunnels.sh
Created November 22, 2017 15:49
SSH tunnels
# Reverse Tunnel
ssh -R *:REMOTE_LISTEN_PORT:localhost:LOCAL_LISTEN_PORT user@remotehost -p PORT -N -C -q
# Socks (v5) proxy
ssh -D 9150 user@remotehost -p PORT -N -C -q
# Fork and quiet
-f -q
# /etc/ssh/sshd_config