For blue-man haters

cat ../bin/btspeaker
#!/bin/bash

expect -c ”
spawn sudo bluetoothctl
expect #
send power\ on\ \n
expect Changing\ power\ on\ succeeded
expect #
send connect\ BLUETOOTH PHYSICAL ADDRESS\ \n
expect Connection\ successful
expect #
send quit\n
interact

exit

cat ../bin/disbtspeaker
#!/bin/bash

expect -c "
spawn sudo bluetoothctl
expect #
send power\ on\ \n
expect #
send disconnect\ MAC\ \n
expect #
send quit\n
interact
"

exit

Advertisements

Running Big IP virtual editon trial on KVM

Big IP for KVM only works for certain versions of KVM, and it won’t even lets you go into tmsh for other KVM version. Here is a workaround.
Since we can’t access to tmsh, you might won’t to add ip address to eth0 interface via “ip addr add “ipaddr/mask” dev eth0″ command, if you want to ssh to bigip.

First rewrite /bin/qp script which is executed on boot.
This just echoes platform infomation to /PLATFORM file.
The platform infomation is copied from BIG IP Virtual edition for vmware.

# vim /bin/qp

#!/bin/sh

echo "Z100"

if [ ! -f /PLATFORM ] ; then
echo "platform=Z99
family=0xC0000000
host=Z99
systype=0x76" > /PLATFORM
fi

Also rewrite the PLATFORM file directly. I am not sure this step is necessary.
Some of the guidance out there say it should be done, so I am just doing it just in case.

vim /PLATFORM

platform=Z99
family=0xC0000000
host=Z99
systype=0x76

And then, reboot. It should come up with no error.

my minimal zshrc and bashrc with completion

Install grml-zsh-config from repository, if you don’t want it minimal.

More minimal version is posted in the following link.
https://tech.wildduck.xyz/post/minimal-zshrc/

## Aliases
alias ls='ls --color=auto'
alias vi='vim'
alias ssh='TERM=xterm-256color ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'

# Paths
export PATH=$PATH:~/bin

# Prompt
PROMPT=[%n@%m\ %c\]%(!.#.$)\

# History
HISTFILE=.zsh_history
HISTSIZE=1000
SAVEHIST=1000
setopt EXTENDED_HISTORY
setopt HIST_FIND_NO_DUPS
setopt INC_APPEND_HISTORY

# Keybind
# For the control code, open your terminal and press ctrl+v and press whatever key you want to assign.
# Keybind
bindkey '^[OC' forward-word
bindkey '^[Oc' forward-word
bindkey '^[[1;5C' forward-word
bindkey '^[OD' backward-word
bindkey '^[Od' backward-word
bindkey '^[[1;5D' backward-word
bindkey '^[[1~' beginning-of-line
bindkey '^[[7~' beginning-of-line
bindkey '^[OH' beginning-of-line
bindkey '\033[H' beginning-of-line
bindkey '^[[1;6D' beginning-of-line
bindkey '^[[8~' end-of-line
bindkey '^[[4~' end-of-line
bindkey '^[OF' end-of-line
bindkey '\033[F' end-of-line
bindkey '^[[1;6C' end-of-line
bindkey '^[[3~' delete-char

# Completion
autoload -Uz compinit
compinit
# Spelling correction
setopt correct
# Auto cd
setopt autocd

bashrc


# History
HISTTIMEFORMAT="%d/%m/%Y %T "

# Bash-completion options
shopt -s autocd
shopt -s cdspell
shopt -s extglob
shopt -s histappend
shopt -s lithist
shopt -s dotglob
shopt -s nocaseglob
shopt -s nocasematch