Skip to content

Instantly share code, notes, and snippets.

@glazeus
glazeus / gist:144dcce70e00124d885fc52a3909797a
Created October 3, 2018 13:40 — forked from Khoulaiz/gist:41b387883a208d6e914b
Checking ports without telnet

Here are several different ways to test a TCP port without telnet.

$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C

$ cat &lt; /dev/tcp/127.0.0.1/23
@glazeus
glazeus / bash-current-folder-location.md
Last active August 27, 2018 09:32
bash-current-folder-location

Change 'w' to 'W'

FROM (like):

PS1='${debian_chroot:+($debian_chroot)}[\033[01;32m]\u@\h[\033[00m]:[\033[01;34m]\w[\033[00m]$ '

TO (like):

PS1='${debian_chroot:+($debian_chroot)}[\033[01;32m]\u@\h[\033[00m]:[\033[01;34m]\W[\033[00m]$ '

location: >cat ~/.bashrc | grep 'PS1='

@glazeus
glazeus / links.md
Created July 7, 2018 13:37 — forked from g0t4/links.md
Starting Point Files for Jenkins2 Getting Started course
@glazeus
glazeus / get-ip-from-srv-record.sh
Created June 29, 2018 10:56
get-ip-from-srv-record
i=0; for srvrecord in `host -t SRV $SrvServiceDiscoveryServiceDns | awk '{ print substr($8, 1, length($8)-1)}'`; do arr[$i]=$(host $srvrecord | grep -oE '((1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])'); echo "arr[$i] is ${arr[$i]}"; i=$(expr $i + 1); done
#!/bin/bash
mkdir /tmp/skype/; cd /tmp/skype
wget https://repo.skype.com/latest/skypeforlinux-64.deb
sudo apt install ./skype*.deb -y
@glazeus
glazeus / installation.sh
Last active May 4, 2018 05:48
Stretch-Adobe-Flash-Firefox
mkdir /tmp/flash; cd /tmp/flash
wget https://fpdownload.adobe.com/get/flashplayer/pdc/29.0.0.140/flash_player_npapi_linux.x86_64.tar.gz
tar -xzf *.tar.gz; ls -la
sudo cp libflashplayer.so /usr/lib/mozilla/plugins
sudo cp -r usr/* /usr
#Source: https://wiki.debian.org/FlashPlayer
@glazeus
glazeus / prtscrn.sh
Created May 3, 2018 07:39
PrintScreen-gnome
#save region to clipboard and file
#work fine via terminal but won't viakeyboardshirtcut association: ~/Pictures/screenshots/--/--.png
sh -c 'gnome-screenshot -ac | mkdir -p ~/Pictures/screenshots/$(date +%Y-%m-%d) && xclip -selection clipboard -t image/png -o > ~/Pictures/screenshots/$(date +%Y-%m-%d)/$(date +%H-%M-%S).png'
#save to clipboard only
bash -c 'gnome-screenshot -ac'
@glazeus
glazeus / gpu.sh
Created April 29, 2018 19:54
Check-GPU
lspci -k | grep -EA3 'VGA|3D|Display'
#Integrated
lspci | grep VGA
#00:02.0 VGA compatible controller: Intel Corporation Device 591b (rev 04)
glxinfo|egrep "OpenGL vendor|OpenGL renderer"
lspci | grep VGA ; lsmod | grep "kms\|drm" ; find /dev -group video ; \
cat /proc/cmdline ; find /etc/modprobe.d/; cat /etc/modprobe.d/*kms* ; \
@glazeus
glazeus / DELL-9560-Optimus-results
Last active April 29, 2018 22:41
XPS 15 9560 Optimus battle
HW: XPS 15 9560 i7-7700HQ 2x8GB 4K TouchScreen with Nvidia GTX 1050 and Intel HD 630
scale: 200% scale
browser: chromium
mode: F11
https://web.basemark.com/
Fedora 27: 66.17 (GPU: Intell)
CSS Capabilities58.07%
HTML5 Capabilities92.61%
Page Load and Responsiveness Capabilities93.09%
@glazeus
glazeus / ps.sh
Created April 26, 2018 13:43
Powershell on Linux
#amazonlinux
docker run --rm -it microsoft/powershell:amazonlinux
#ubuntu16.04
docker run --rm -it microsoft/powershell:ubuntu16.04
# https://hub.docker.com/r/microsoft/powershell/
# https://github.com/PowerShell/PowerShell