The goal of efficiency is more slack.

Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Tuesday, June 01, 2021

Fixing sound on RetroPie after updating and installing Desktop Environment

I started out by imaging retropie-buster-4.7.1-rpi2_3.img.gz onto an SD card for a Raspberry Pi 3 B. Then I updated the software using the menus in EmulationStation. Then I installed the desktop environment, again with the ES menus. What resulted was audio no longer working in EmulationStation and the console emulators. I did a whole bunch of things to troubleshoot, so I'm not sure what actually made it work.

/boot/config:

hdmi_drive=2
hdmi_force_hotplug=1
hdmi_force_edid_audio=1

Install:

sudo apt install pavucontrol pulseaudio-utils
sudo apt-get install lxplug-volumepulse

In the desktop environment, add Volume Control panel to the menu bar.

In EmulationStation, Audio Card: hw, Audio Device: HDMI.

Troubleshooting

Play audio with Alsa:

sudo aplay /usr/share/sounds/alsa/Front_Center.wav

Speaker test:

speaker-test -D sysdefault -t wav

Thursday, July 02, 2020

Tuesday, November 07, 2017

Fix init sequence in Raspberry Pi

If the init sequence gets broken and you can't get to a shell on a Raspberry Pi (I'm using 3 model B), you can boot into recovery mode this way.
  • Hit shift when starting up.
  • Hit "e" to edit config
  • tab over to cmdline.txt
  • add to the end of the line
    init=/bin/sh
  • hit ok, then Esc to boot...... it will boot you in to a command line
    # mount -n -o remount,rw / (this will remount / so you can make changes)
  • now you should be able to edit the init.d config.
  • when you reboot again.... hold shift and remove the init=/bin/sh
Source: raspberrypi.stackexchange.com

Friday, October 13, 2017

Verifying OpenSSL certificates

Verifying that a certificate is issued by a CA

How to use OpenSSL on the command line to verify that a certificate was issued by a specific CA, given that CA's certificate:
$ openssl verify -verbose -CAfile cacert.pem  server.crt
server.crt: OK

Verify that a private key matches a certificate

$ openssl x509 -noout -modulus -in server.crt | openssl md5
$ openssl rsa -noout -modulus -in server.key | openssl md5
The resultant hashes should match.

Friday, August 18, 2017

My temporary development environment

Here is how I set up my tools on a computer I'm temporarily using, such as one at the library.

Putty

  1. Download putty from www.chiark.greenend.org.uk
  2. Putty > Window > Colours > ANSI Blue > Red: 60, Green: 60, Blue: 255
  3. Putty > Session > Default Settings > Save
  4. Save a new session with the following set:
    1. Session > Host Name
    2. Connections > Data > Auto-login username.

 Vim

~/.vimrc:
syntax enable
set ic
set expandtab shiftwidth=4 smarttab autoindent
Note: Superseded by Vim for Python, which is more comprehensive.

 Screen

~/.screenrc:
shell -$SHELL
termcapinfo * ti@:te@
startup_message off

Bash

~/.bash_profile
# EDITOR
export EDITOR=vim


Websites

https://www.blogger.com for note taking
https://github.com

Creating paths in Python

Let's say you had this tree:
/home/me/example.com/passenger_wsgi.py
/home/me/example.com/virtualenv
In the Python script, to refer to the directory that is sibling to the script:
os.path.join(os.path.dirname(os.path.abspath(__file__)), 'virtualenv')
Note that this will yield the same result even if the script is a symlink to a file located elsewhere, i.e. __file__ refers to the location of the symlink and not the original file.

Saturday, June 19, 2010

Blog from the command line

GoogleCL allows you to post to your Blogger blog from the command line. To install:
  1. Install Python gdata libraries. This entails downloading, untarring, and sudo python setup.py
  2. Install GoogleCL. Same as above.
  3. Copy googlecl-0.9.5/build/scripts-2.6/google (version numbers subject to change) to /usr/local/bin or anywhere else in you PATH.
Now you can open a terminal and run a command like:

google blogger post --tags "online, shell" --title "Frist post using GoogleCL" "Can you believe I'm posting this from the command line?"

Or write your post in a text editor, saving it as ~/tmp/post.html, then:

google blogger post --tags "online, shell" --title "Blog from the command line" ~/tmp/post.html

Popular Posts

Recent Posts

Unordered List

Text Widget

Pages

Powered by Blogger.
Scroll To Top