vnoremap :w !xclip -i -sel c
i.e. some stuff and junk about Python, Perl, Matlab, Ruby, Mac X, Linux, Solaris, ...
Saturday, December 15, 2018
Thursday, November 22, 2018
PulseAudio: Stream sound from home to work computer over ssh and vnc
1. At work use papref to "Enable network access to local sound devices"and restart computer.
2. Copy pulse cookie from work to home: ~/.config/pulse/cookie so that work and home computer share same secret (cookie).
3. At work start: sudo start-pulseaudio-x11
4. At work open reverse tunnel for pulseadio: ssh -X -R 9998:localhost:4713 home
5. At work use vnc to connect to home.
6. Once connected using vnc to home, start firefox (for example) at home computer using: PULSE_SERVER=localhost:9998 firefox
The instructions are based on this: http://psung.blogspot.com/2011/09/network-audio-with-pulseaudio-made.html
2. Copy pulse cookie from work to home: ~/.config/pulse/cookie so that work and home computer share same secret (cookie).
3. At work start: sudo start-pulseaudio-x11
4. At work open reverse tunnel for pulseadio: ssh -X -R 9998:localhost:4713 home
5. At work use vnc to connect to home.
6. Once connected using vnc to home, start firefox (for example) at home computer using: PULSE_SERVER=localhost:9998 firefox
The instructions are based on this: http://psung.blogspot.com/2011/09/network-audio-with-pulseaudio-made.html
Thursday, October 25, 2018
Atom: Change command-palette:toggle keybinding
'atom-text-editor:not([mini])':
'ctrl-shift-:': 'command-palette:toggle'
Friday, October 19, 2018
Arch: System freezes when coping large files from usb
Add the following two lines to /etc/sysctl.d/99-sysctl.conf (create if not exists)
To apply use
vm.dirty_background_ratio=1
vm.dirty_ratio=2
vm.vfs_cache_pressure = 50
To apply use
sudo sysctl -p /etc/sysctl.d/99-sysctl.conf
or restart.
Labels:
Arch
Tuesday, October 02, 2018
Arch: Python 3.6 rpc/rpc.h missing
The solution was to manually specify where `rpc/rpc.h` was for configuration:
CPPFLAGS="-I/usr/include/tirpc" ./configure --prefix=/opt/python362 --enable-shared -I/usr/include/tirpc
Sunday, September 30, 2018
Monday, September 24, 2018
youtube-dl: download mp3 and skip on failure
youtube-dl --extract-audio --audio-format mp3 -i PLAYLIST_URL_OR_VIDEO_LINK
Labels:
Linux,
youtube-dl
Sunday, September 23, 2018
Docker: Install Amazon Linux for AWS lambda development
docker run -ti -v ~/mylambdapackage:/mylambdapackage amazonlinux:2017.03.1.20170812
From: https://medium.com/@samme/setting-up-python-3-6-aws-lambda-deployment-package-with-numpy-scipy-pillow-and-scikit-image-de488b2afca6
Monday, September 17, 2018
MATLAB: vision.ShapeInserter crashes in Arch Linux
Seems its same problem as here: https://au.mathworks.com/matlabcentral/answers/364727-why-does-matlab-crash-on-linux-fedora-26-with-a-segmentation-violation-r2017b-or-later#answer_289066
Solution was to remove libfreetype files from /opt/MATLAB/R2016a/bin/glnxa64
Solution was to remove libfreetype files from /opt/MATLAB/R2016a/bin/glnxa64
sudo mv libfreetype* exclude/
Sunday, September 16, 2018
Thursday, September 06, 2018
Thursday, August 30, 2018
rsync: make a backup
Example:
rsync -avh -R --info=progress2 --delete /home/source/folder /run/media/backup/folder
Wednesday, August 29, 2018
rsync: copy files over ssh with non-default port
rsync -azvh -e 'ssh -p 22222' ./source_folder user@destination_ip:/destination/folder/name
Thursday, August 23, 2018
Setting default terminal in Nemo
gsettings set org.cinnamon.desktop.default-applications.terminal exec terminal
Labels:
nemo,
termiantor
Thursday, July 12, 2018
ffmpeg: Extract audio to mp3 from multiple mp4 video files
for i in *.mp4; do ffmpeg -i "$i" -q:a 0 -map a "$(basename "$i" .mp4)".mp3 ; done
Sunday, July 08, 2018
Linux: Download audo only from twitch (including live stream)
Show available video formats:
Download only audio:
youtube-dl --list-formats twitch_url_to_video
Download only audio:
youtube-dl -f audio_only twitch_url_to_video
Labels:
Linux,
twitch,
youtube-dl
Wednesday, July 04, 2018
Manjaro: Remove steam and microsoft office
sudo pacman -Rd steam-devices steam-manjaro ms-office-online
Labels:
Manjaro
Thursday, June 07, 2018
Cmake: compile using clang instead of gcc
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
cmake ..
Thursday, May 31, 2018
ssh config
Example
From: https://nerderati.com/2011/03/17/simplify-your-life-with-an-ssh-config-file/
# contents of $HOME/.ssh/config
Host dev
HostName dev.example.com
Port 22000
User fooey
From: https://nerderati.com/2011/03/17/simplify-your-life-with-an-ssh-config-file/
Labels:
ssh
Tuesday, May 29, 2018
vncviewer: Increase compression levels and reduce bandwitch
vncviewer -QualityLevel=7 -FullColor=0 -LowColorLevel=2 -CompressLevel=3 :3
Monday, May 28, 2018
i3: add rofi key $mod+d
Edit .config/i3/config:
bindsym $mod+d exec "rofi -combi-modi window,drun -show combi"
Friday, May 18, 2018
Tuesday, May 15, 2018
Search for a string in txt file in all sub-directories
find dir/ -name *.txt -type f -exec grep -H 'string' {} +
Labels:
Linux
Sunday, May 13, 2018
Arch: List of recently installed and upgraded packages
cat /var/log/pacman.log | grep -i upgraded
cat /var/log/pacman.log | grep -i installed
Labels:
Arch
Monday, April 30, 2018
Tilix: Arch config settings file location
The config parameters are stored in dconf. Install `dconf-editor` from aur to edit them
In the dconf-editor search for "Tilix" to find its settings, or go to /com/gexperts/Tilix
yaourt -S dconf-editor
In the dconf-editor search for "Tilix" to find its settings, or go to /com/gexperts/Tilix
Sunday, April 29, 2018
Start MATLAB in Linux termianal
alias mat="/opt/MATLAB/R2016a/bin/matlab -softwareopengl -nodesktop -nosplash"
Sunday, February 18, 2018
Lowess smooth in logistic regression using R based on Applied Logistic Regression, 3th ed, HOSMER
To to determine linearity in the logit for a continuous variable, one can use lowess smoothed
scatterplot as described in Applied Logistic Regression, 3rd Edition, in chapter 4.2.1 Methods to Examine the Scale of a Continuous Covariate in the Logit.
In the book this is illustrated using Scale_Example data from the book and STATA. I dont have stata, but this can be replicated with a good agreement in R.
For this, I will use logitloess function described here.
The data sets used in the book can be obtained here: http://wiley.mpstechnologies.com/wiley/BOBContent/searchLPBobContent.do
The resulting plot is very similar to the one provided in the book (Figure 4.1). Its not exactly same, but this could be due to differences in the implementation of the logitloess methods between R and STATA. Nevertheless, the conclusions from the plot obtained in R are same as those in the book.
In the book this is illustrated using Scale_Example data from the book and STATA. I dont have stata, but this can be replicated with a good agreement in R.
For this, I will use logitloess function described here.
The data sets used in the book can be obtained here: http://wiley.mpstechnologies.com/wiley/BOBContent/searchLPBobContent.do
# read in Scale_Example.txt that contains data for the example
mydata = read.table("~/Applied_Logistic_Regression_by_Hosmer_Lemeshow_3th_ed_2013/Scale Example/Scale_Example.txt")
# seperate data into x and y
y=mydata[,1]
x=mydata[,2]
# plot lowess graph
logitloess(x,y)
The resulting plot is very similar to the one provided in the book (Figure 4.1). Its not exactly same, but this could be due to differences in the implementation of the logitloess methods between R and STATA. Nevertheless, the conclusions from the plot obtained in R are same as those in the book.
Labels:
Linux,
R,
Statistics
Friday, February 16, 2018
Sunday, February 11, 2018
SublimeText3: Gcc build system and termiantor
create new build system
subl3 ~/.config/sublime-text-3/Packages/User/gcc.sublime-build
with the contents of
{
"shell_cmd": "g++ \"${file}\" -o \"${file_path}/${file_base_name}\"",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Run",
"shell_cmd": "terminator -e 'gcc \"${file}\" -o \"${file_path}/${file_base_name}\" && \"${file_path}/${file_base_name}\";echo;echo; echo Press ENTER to continue; read line;exit; exec bash'"
}
]
}
Based on https://stackoverflow.com/a/30724183/248823
Thursday, February 08, 2018
Arch: dell inspiron 1545 Broadcom Limited BCM4312
Have to install this driver: https://www.archlinux.org/packages/?name=broadcom-wl-dkms
sudo pacman -S linux-headers broadcom-wl-dkms
Then after reboot wlp12s0 device was found:
ip link
1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp9s0: mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
link/ether 00:25:64:47:bd:bb brd ff:ff:ff:ff:ff:ff
3: wlp12s0: mtu 1500 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 1000
link/ether 00:22:5f:d3:14:d2 brd ff:ff:ff:ff:ff:ff
Tuesday, February 06, 2018
Arch: Wine and GPower
GPower 4.1 installs in wine 3.0 and runs, but freezes after executing calculations due to some problems with drawing the results's plot. To fix the freezing, need to install gdiplus and lib32-gnutls:
This fixes the freezes, although the plots can't be still seen.
winetricks vcrun6 lib32-gnutls gdiplus
This fixes the freezes, although the plots can't be still seen.
Friday, February 02, 2018
Thursday, January 25, 2018
youtube-dl: download continue playlist
youtube-dl --download-archive downloaded.txt --no-post-overwrites -cwix --audio-format mp3
Labels:
Linux
Subscribe to:
Posts (Atom)