The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,403 other followers

Archive for the ‘Ubuntu’ Category

PowerShell on Mac OS X and other non-Windows systems

Posted by jpluimers on 2018/07/17

I wasn’t expecting it to be so easy to install PowerShell on Mac OS X:

brew install Caskroom/cask/powershell

In the background it executes this script: https://github.com/caskroom/homebrew-cask/blob/master/Casks/powershell.rb. which indirectly goes through the URL template https://github.com/PowerShell/PowerShell/releases/download/v#{version}/powershell-#{version}.pkg.

On other non-Windows systems, you have to go through GitHub yourself: https://github.com/powershell/PowerShell. The PowerShell team at Microsoft has many more repositories including the Win32-OpenSSH port which you can find through https://github.com/PowerShell.

At the time of writing, PowerShell was available for these platforms:

Platform Downloads How to Install
Windows 10 / Server 2016 (x64) .msi Instructions
Windows 8.1 / Server 2012 R2 (x64) .msi Instructions
Windows 7 (x64) .msi Instructions
Windows 7 (x86) .msi Instructions
Ubuntu 16.04 .deb Instructions
Ubuntu 14.04 .deb Instructions
CentOS 7 .rpm Instructions
OpenSUSE 42.1 .rpm Instructions
Arch Linux Instructions
Many Linux distributions .AppImage Instructions
macOS 10.11 .pkg Instructions
Docker Instructions

The first version I installed on Mac OS X was this: ==> Downloading https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.17/powershell-6.0.0-alpha.17.pkg

By now I really hope it is out of Alpha state.

–jeroen

via:

Posted in *nix, Apple, CommandLine, Development, iMac, Linux, Mac, Mac OS X / OS X / MacOS, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, openSuSE, Power User, PowerShell, PowerShell, Scripting, Software Development, SuSE Linux, Ubuntu | Leave a Comment »

Ubuntu: Fixing the myserious “Failed to stop apt-daily.timer: Connection timed out”

Posted by jpluimers on 2018/05/14

Ubuntu is the only Linux system I had that – after installing a text-mode console setup – gets itself in the below state with only running apt update and apt-get upgrade.

Preparing to unpack .../archives/apt_1.2.19_armhf.deb ...
Failed to stop apt-daily.timer: Connection timed out
See system logs and 'systemctl status apt-daily.timer' for details.
Failed to get load state of apt-daily.timer: Connection timed out
dpkg: warning: subprocess old pre-removal script returned error exit status 1

I could not find meaningful search results for the above thing, nor did systemctl status apt-daily.timer return anything better than

Failed to get properties: Failed to activate service 'org.freedesktop.systemd1': timed out

Heck, it doesn’t even reboot any more (no helpful search results either):

# reboot
Failed to start reboot.target: Failed to activate service 'org.freedesktop.systemd1': timed out
See system logs and 'systemctl status reboot.target' for details.
Failed to open /dev/initctl: No such device or address
Failed to talk to init daemon.

Nor did systemctl status reboot.target return anything better than

Failed to get properties: Failed to activate service 'org.freedesktop.systemd1': timed out

From the ubuntu-16.04-minimal-odroid-c1-20160817.img.xz base system, it only had these extra packages installed:

  • etckeeper
  • tmux
  • speedtest-cli
  • sendemail

Workaround found, but still unsure why this happened in the first place

Despite the workaround below, I still don’t know why I got into this situation and this leaves me with a very uncomfortable feeling.

Too bad some systems (like ODroid) only have Ubuntu based distributions as sorting out stuff like above took me way too much effort.

Read the rest of this entry »

Posted in *nix, Development, Hardware Development, Linux, Odroid, Power User, Ubuntu | Leave a Comment »

How to Install and Configure Postfix as a Send-Only SMTP Server on Ubuntu 16.04 | DigitalOcean

Posted by jpluimers on 2018/02/16

[WayBackHow to Install and Configure Postfix as a Send-Only SMTP Server on Ubuntu 16.04 | DigitalOcean

Postfix is a *mail transfer agent* (MTA), an application used to send and receive email. In this tutorial, we will install and configure Postfix so that it can be used to send emails by local applications only.

–jeroen

Posted in *nix, Linux, Power User, Ubuntu | Leave a Comment »

Using a Mac for prepping the SD-card for an ODROID-C1+

Posted by jpluimers on 2018/02/12

Some notes based on The woods and trees of OpenSuSE on single-board computers – image abbreviations – and getting it installed using OS X « The Wiert Corner – irregular stream of stuff.

I needed to get Ubuntu on an ODROID-C1+ (as it looks like nobody is maintaining a current OpenSuSE for it).

Installing the ODROID-C1+ image using OS X

Download image

Download either of these (note that “minimal” is different from “mate minimal”; see https://www.youtube.com/watch?v=jOYWx_YToh8) from de.eu.odroid.in/ubuntu_16.04lts:

Put image on SD card

I installed on a 8 gigabyte SD card that revealed itself as /dev/disk1 using this diskutil command (via osx – List all devices connected, lsblk for Mac OS X – Ask Different [WayBack])

diskutil list

So this wrote the image to SD card in a sudo su - prompt:

targetDevice="disk1"
unxz --keep ubuntu-16.04-minimal-odroid-c1-20160817.img.xz; \
diskutil umount "/dev/${targetDevice}s1"; \
dd bs=1m of="/dev/r${targetDevice}" if=ubuntu-16.04-minimal-odroid-c1-20160817.img; \
sync; \
diskutil list; \
diskutil eject "/dev/${targetDevice}"

Boot and first time steps on Odroid

Use the default user and password that [WayBackODROID Forum • View topic – Ubuntu Minimal User / Password mentions:

odroid login: root
Password: odroid

From there, create a new user and add it to the sudo group (I used visudo to check the correct group for sudoers) :

adduser jeroenp
addgroup jeroenp sudo

And then hook it up to the network and get the IP address:

ifconfig

Now you can ssh into the odroid with user jeroenp and the password assigned to it. You can also perform a sudo su - to get to root level.

ssh and configure a few things

First of all, install etckeeper as it’s a life saver:

apt-get install etckeeper

This will install some other packages, but that’s OK; it will end suggesting you to enter email address, name and perform an initial commit:

Initialized empty Git repository in /etc/.git/

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'root@odroid.(none)')
etckeeper commit failed; run it by hand

Do that:

cd /etc
git config --global user.email "example@example.org"
git config --global user.name "Example User"
git commit -m "initial commit"

Now perform these steps:

  1. Change the root password
  2. Disable etckeeper daily autocommits
  3. Change the hostname
  4. Update/Upgrade/Distribution-upgrade
  5. Fix the cursor in console mode

Change root password:

# sudo su -
# passwd
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

Disable etckeeper daily autocommits involves one line in /etc/etckeeper/etckeeper.conf:

-#AVOID_DAILY_AUTOCOMMITS=1
+AVOID_DAILY_AUTOCOMMITS=1

Change the hostname; assuming your new host name is newHostName.

  1. edit /etc/hosts and replace the old hostname with newHostName
  2. Perform these commands:
    hostnamectl set-hostname newHostName
    exec bash
    hostname -f

Both the command prompt and the hostname output should show newHostName.

Update/Upgrade:

apt-get update
apt-get upgrade

Fix the cursor in console mode:

Somehow the Odroid C1+ does not support a blinking hardware text cursor.

 

–jeroen

Posted in Development, Hardware Development, Linux, Odroid, openSuSE, Raspberry Pi, SuSE Linux, Tumbleweed, Ubuntu | Leave a Comment »

Odroid-C1 (and likely others): fixing the textmode cursor on the physical console

Posted by jpluimers on 2018/02/05

Somehow the Odroid C1+ does not support a blinking hardware text cursor. Which means that when you logon to the console in text mode, it is really hard to edit the command-line or text files a there is no visual clue where the cursor is.

It took me to find out the cause, but odroid C1 console no “hardware cursor” got me there: [Archive.isArch Linux ARM • View topic – ODROID-C1: No hardware cursor in terminal. The odd thing is that sending escape sequences like mentioned in [WayBackCursor Appearance in the Linux Console LG #137 didn’t fix the problem either. For instance, these didn’t help at all:

echo -n -e '\e[?17;14;224c'
echo -e "\e[?16;0;64c"

I tried similar ones from [WayBackVGA-softcursor.txt as well, but they failed too.

Since I usually ssh into the box, doing without a console cursor usually is no problem except when you run into network trouble and really need the console.

Fixing it took a bit longer to find out,  but refining to  “odroid C1” console no blinking cursor got this as first hit: [WayBackODROID Forum • View topic – fbcon cursor. And it came down to going to the second page of the first archived link above. So I had a kind of “duh” moment. Anyway, at [WayBackArch Linux ARM • View topic – ODROID-C1: No hardware cursor in terminal – pagee 2 is the below code which got me a nice large light-blue cursor:

infocmp >> ~/terminfo.txt
sed -i.bak -e 's/?0c/?112c/g' -e 's/?8c/?48;0;64c/g' terminfo.txt
tic terminfo.txt
tput cnorm

These are the commands used:

–jeroen

Posted in *nix, Linux, Power User, Ubuntu | Leave a Comment »

 
%d bloggers like this: