openssl genrsa -out server.key 2048
openssl req -new -x509 -key server.key -out server.pem -days 3650
# Released by rdb under the Unlicense (unlicense.org) | |
# Based on information from: | |
# https://www.kernel.org/doc/Documentation/input/joystick-api.txt | |
import os, struct, array | |
from fcntl import ioctl | |
# Iterate over the joystick devices. | |
print('Available devices:') |
TCL-Expect scripts are an amazingly easy way to script out laborious tasks in the shell when you need to be interactive with the console. Think of them as a "macro" or way to programmaticly step through a process you would run by hand. They are similar to shell scripts but utilize the .tcl
extension and a different #!
call.
The first step, similar to writing a bash script, is to tell the script what it's executing under. For expect
we use the following:
#!/usr/bin/expect
#!/usr/bin/expect -f | |
set timeout 60 | |
set host [lindex $argv 0] | |
stty -echo | |
send_user -- "Password for $host: " | |
expect_user -re "(.*)\n" | |
send_user "\n" | |
stty echo | |
set password $expect_out(1,string) |
package main | |
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"encoding/base64" | |
"fmt" | |
"io" | |
) |
See this post on the ArchLinux forum ArchLinux >> Newbie Corner >> Top is red
remove your ~/.toprc (if any)
- start "top"
- press z
- press V
- press 1
- press y
- press m m
# encoding: utf-8 | |
require "timeout" | |
# Capture the standard output and the standard error of a command. | |
# Almost same as Open3.capture3 method except for timeout handling and return value. | |
# See Open3.capture3. | |
# | |
# result = capture3_with_timeout([env,] cmd... [, opts]) | |
# |
package main | |
import ( | |
"fmt" | |
"io" | |
"io/ioutil" | |
"log" | |
"code.google.com/p/go.crypto/ssh" | |
"code.google.com/p/go.crypto/ssh/terminal" |
umount: device is busy. Why? | |
There are several reasons why a file system cannot be unmounted. Here are a few of the reasons. | |
Working directory or file open of a running process | |
# umount /mnt/test | |
umount: /mnt/test: device is busy. | |
(In some cases useful info about processes that use | |
the device is found by lsof(8) or fuser(1)) | |
# lsof /mnt/test/ |