Announcement

Collapse
No announcement yet.

Using Linux with HomeSeer

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Using Linux with HomeSeer

    There have been some discussions lately about Linux/Windows and permissions as they relate to security. Here's a tip that I'm not even sure where I found. When operating at the command line I find it helpful to have the terminal colorize things for me. If I sudo su to get past some permission limitations a different color prompt reminds me that I am currently root. It also helps when you are following script logic. In Linux, all of the terminals are controlled by your default shell, which in general will be /bin/bash. To change the behavior of your terminal you need to change bash. In your /home/<user> folder there is a hidden file: .bashrc. It is a script that bash runs whenever you start it interactively. If you started with a headless server it probably has the color commands in there but commented out. For a more colorful and enlightening terminal user experience, remove the # from in front of lines that look like this:

    if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
    # We have color support; assume it's compliant with Ecma-48
    # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
    # a case would tend to support setf rather than setaf.)
    color_prompt=yes
    else
    ------------------------------------------------------------------------------
    # enable color support of ls and also add handy aliases
    if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    alias dir='dir --color=auto'
    alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'

    fi
    ------------------------------------------------------------------------------
    You may want to follow this instruction instead of editing the main .bashrc file:

    # Alias definitions.
    # You may want to put all your additions into a separate file like
    # ~/.bash_aliases, instead of adding them here directly.
    # See /usr/share/doc/bash-doc/examples in the bash-doc package.

    if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
    fi
    -------------------------------------------------------------------------------
    If you are wondering what ~ is, that is shorthand for the path to your home folder. In my case ~ means:
    /home/mikaluch

    If you are wondering what mikaluch means my name is Michael but my Italian grandfather always called me Mikaluch! with great gusto. I don't know. We checked. As far as I can tell it is not Italian for Michael.

    #2
    Last edited by Pete; July 12, 2016, 06:53 AM.
    - Pete

    Auto mator
    Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb
    Homeseer Zee2 (Lite) - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e - CherryTrail x5-Z8350 BeeLink 4Gb BT3 Pro
    HS4 Lite - Ubuntu 22.04 / Lenovo Tiny M900 / 32Gb Ram

    HS4 Pro - V4.1.18.1 - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
    HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

    X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

    Comment

    Working...
    X