Category: Gnome

Apr 08

Gnome Desktop Shortcut

GNOME Desktop Shortcut

Just another note about this. See previous also.

Create in user Desktop folder

$ cat crypto-report.desktop 
[Desktop Entry]
Version=1.0
Exec=/home/rrosso/scripts/crypto-report.sh
Name=crypto-report
GenericName=crypto-report
Comment=run crypto-report script
Encoding=UTF-8
Terminal=true
Type=Application
Categories=Application;Network;

Script

$ cat ~/scripts/crypto-report.sh 
#!/bin/bash

commands () {
    cd /TANK/DATA/MySrc/crypto-totals-api
    python3 consolidated-crypto-report.py
    $SHELL # keep the terminal open after the previous commands are executed
}

export -f commands

gnome-terminal --profile=crypto-report -- bash -c "commands"

NOTE: May have to right click on shortcut on the desktup and allow to tun.

Comments Off on Gnome Desktop Shortcut
comments

Jan 01

Gnome Desktop Shortcut Exec

Executing commands or scripts from a GNOME desktop shortcut

I have a few scripts that I only periodically execute. For example a backup to a USB not always plugged in or to a computer not always online. For convenience I made some shortcuts on my GNOME desktop. I can easily just run these in a terminal of course but sometimes I just want to quickly click an icon and finish.

There are a few idiosyncracies around executing like this. In general you may have run into passing processes variables and redirection of output issues. In addition to those also "Exec" inside a desktop shortcut adds a few more issues. Read here for the Desktop Entry Specification

For my purposes here are example entries from .desktop files:

Rsync to USB

Exec=gnome-terminal --profile=job-output -e 'sudo /home/rrosso/scripts/rsync-TANKs-2TBUSB.sh'

Update IP address in a remote firewall

Exec=gnome-terminal --profile=job-output -- /bin/sh -c 'cd /TANK/DATA/MySrc ; python3 ip-add-iqonda-aws.py ; sleep 60'

Executing using bash with date in log file:

Exec=bash -c "sudo /root/scripts/zfs-replication.sh -w 1 -t 192.168.1.79 | tee /TANK/backups/logs//bin/date +%%Y-%%m-%%d-desktop-zfs-replicate-192.168.1.79.log"

I also prefer using gnome-terminal so I can format the output on the screen better:

Exec=gnome-terminal --profile=job-output -- bash -c "sudo /root/scripts/zfs-replication.sh -w 1 -t 192.168.1.79 | tee /TANK/backups/logs//bin/date +%%Y-%%m-%%d-desktop-zfs-replicate-192.168.1.79.log ; sleep 60"

Comments Off on Gnome Desktop Shortcut Exec
comments

Jun 21

SSH Connection Manager

I previously wrote a quick post on using a connection manager in Linux. Link here:

Linux tabbed SSH connection manager

I have used for the most part something called the Gnome Connection Manager. However it is poorly maintained and had a few small annoyances also.

I revisited a utility called PAC Manager (link here https://sourceforge.net/projects/pacmanager/).

So far it does pretty much everything I need as far as maintaining details for server names and SSH login information. It does have tabbed windows, organize in groups and an amazing number of customization features. It also integrates pretty nicely with KeePass to maintain passwords with.

It would be better if the main distros include this tool but it does at least have .deb and .rpm packages.

I also gave a current version of Remmina another try as it seems best maintained of the bunch but it still gave me unexpected behavior. Like a SSH window just disappearing etc.

Comments Off on SSH Connection Manager
comments

Oct 30

Network Manager VPN Connections

I have documented previously that the Linux network manager can be used to connect to several different VPN gateways.  There are several network manager plugins available for the different VPN solutions.  The pptp plugin is used frequently but for newer Cisco gateways you should use the network-manager-openconnect-gnome plugin. You should use the network-manager-vpnc plugin to connect to older Cisco gateways.

The vpnc plugin also happens to work for Palo Alto GlobalProtect concentrators.  For the vpnc plugin to work with Palo Alto GlobalProtect gateways you need to:

- Enable X-Auth on your VPN gateway. You will also need the group name and password from the VPN administrator.

- Create a "Cisco compatible" VPN when creating your network manager connection.

 

Comments Off on Network Manager VPN Connections
comments

Jul 24

Auto Login and Sudo Security Cheat

Sometimes you have a VM that you just don't care about security.  I do the following to cheat a little on login and sudo.

Update shadow password file will enable tools like gksudo to work.  gksudo is what is used for prompts you get when using System Administration etc...  You don't have to type your password just hit enter.

It has to be this specific string "U6aMy0wojraho" you set.


# grep rrossouw /etc/shadow
rrossouw:U6aMy0wojraho:15910:0:99999:7:::

Give yourself some sudo privileges.  For instance sudo -s won't need a password. Use visudo tool to update sudo policies.


# grep rrossouw /etc/sudoers
rrossouw ALL=(ALL) NOPASSWD:ALL

Enable Auto Login: System Settings -> User Accounts -> Unlock -> Authenticate (No need for password now) -> Click Automatic Login

I also disable my screensaver and password lock on the VM since my host has that enabled through an Active Directory policy already.

Comments Off on Auto Login and Sudo Security Cheat
comments