Linux

Linux: Ubuntu 18.04.3 Change hostname ( for SAMBA, etc )

https://linuxize.com/post/how-to-change-hostname-on-ubuntu-18-04/

hostnamectl

hostnamectl
bamboo

sudo hostnamectl set-hostname jira
hostnamectl
jira

hosts

sudo cp /etc/hosts /etc/hosts.bak
sudo nano /etc/hosts
127.0.1.1 bamboo

127.0.0.1 jira


EDIT cloud.cfg ( if cloud-init installed )

ls -l /etc/cloud/cloud.cfg

setup@bamboo:~$ ls -la /etc/cloud/cloud.cfg
-rw-r--r-- 1 root root 3612 May 11  2019 /etc/cloud/cloud.cfg


Search for preserve_hostname and change the value from false to true:

sudo nano /etc/cloud/cloud.cfg
# This will cause the set+update hostname module to not operate (if true)
preserve_hostname: false

# This will cause the set+update hostname module to not operate (if true)
preserve_hostname: true

Bash: date command

`date +"%y%m%d"`.tgz

$ echo `date +"%y%m%d"`.tgz
191125.tgz

$ echo `date +"%Y%m%d"`.tgz
20191125.tgz


$ date --help
Usage: date [OPTION]...
Tags

Logitech C922 Pro Web Stream 7 OBS Performance Issues

Source: https://obsproject.com/forum/threads/logitech-c922-issues-only-on-obs-not-on-any-other-programs.58702/


TRY THIS...
If the cam is plugged into USB 2.0 port, try plugging it into a USB 3.0 port.
If the cam is plugged into USB 3.0 port, try plugging it into a USB 2.0 port.
ALSO...
Try connecting the webcam to a USB port that is connected to the Motherboard directly, if it already is, connect it to one that's not.

I was having this same issue Thank you so much "So Who You" switching from a 3.0 to a 2.0 port fixed the issue. I really appreciate it


 

Bash: SSH with Tunnel

Syntax

ssh user@remoteHost.com -L 81:remoteHost:81

ssh user@192.168.0.112 -L 81:r192.168.0.112:81

Script

#!/bin/bash
function ssh-tunnel-112(){
        export $(grep -v '^#' .env | xargs)
        echo "ssh to .112:8081 to pi:3001"
        sudo ssh me@192.168.0.112 -L 8081:pi:3001
}
echo "creating tunnel on port 81"
ssh-tunnel-112

 

Tags

Linux: Bash: /bin/bash^M: bad interpreter: No such file or directory

 

/bin/bash^M: bad interpreter: No such file or directory

the ^M is the key to the solution here.... invalid line endings

Windows & Linux use different EOL encoding...

in Notepad++ open the file and then select one according to the runtime host OS

  • Edit > EOL Conversion > Linux(LF)
  • Edit > EOL Conversion > Windows (CR LF)
  • Edit > EOL Conversion > Macinstosh (CR)
Tags
Subscribe to Linux