Showing posts with label bash. Show all posts
Showing posts with label bash. Show all posts

Sunday, November 1, 2020

Install without root access / for current user

 You can use conda to install mysql client!

https://stackoverflow.com/questions/36651091/how-to-install-packages-in-linux-centos-without-root-user-with-automatic-depen/52561058#52561058

Thursday, October 29, 2020

recreate / cloning conda env with limited internet access

  • https://www.anaconda.com/blog/moving-conda-environments
  • https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html

Thursday, April 30, 2020

send email html content with inline image


  • preferred way:
    • script to generate html content with image encoded as base64 text
      • <img src='data:imag/png;base64,....'/>
      • base64.b64encode().decode("ascii") to get that ... string from image
    • single html file to include all the html and images, etc. 😀
    • cat that html and pipe to mutt -e "set content_type=text/html" to send the email

Tuesday, March 3, 2020

url to pdf on linux

yum install wkhtmltopdf
To manipulate the pdfs, use pdfunite / pdfseparate from
yum install poppler-utils

Saturday, December 28, 2019

centos minimal

install centos 8 minimal

install google-chrome from google repo, which should install all the X dependencies

additional language support for web page display
> yum groupinstall Fonts

To start chrome full screen
> X& DISPLAY=:0 google-chrome --window-size=1920,1080&

if sound is not already working,
> yum install alsa-utils
unmute everything with
> alsamixer
https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture#Disabling_auto_mute_on_startup



Monday, February 18, 2019

running graphical applications without desktop env


  1. install linux w/ desktop environment
  2. start run level 3
  3. $ X &
  4. $ DISPLAY=:0 google-chrome
  5. "You can switch from the X server and the framebuffer by using CTRL+ALT+F1 and CTRL+ALT+F7"

https://superuser.com/questions/407043/is-it-possible-to-run-graphical-applications-such-as-firefox-without-installing

Sunday, January 31, 2016

How to install additional kernel to ipython / jupyter?

Assuming you already have python 3 and ipython installed with anaconda,

Create python 2.7 env
$ conda create -n py27 python=2.7

Activate the env
$ source activate py27

Install ipykernel
$ conda install notebook ipykernel

Write kernel spec
$ ipython kernelspec install-self --user
which should write to ~/.local/share/jupyter/kernels/python2

Deactivate 2.7 env
$ source deactivate

link the kernel spec to the location where ipython will read
$ cd ~/.ipython/
$ ln -s ~/.local/share/jupyter/kernels/

Confirm now that we have additional kernel
$ ipython kernelspec list

Start ipython notebook and you should now have both kernels
$ ipython notebook --no-browser

Tuesday, July 14, 2015

Wednesday, January 28, 2015

SQL database / stdout to kdb

// using mysql as an example
// perhaps a good way to just have parsed output (say from perl) to directly go into kdb

q)(::)test:("*TH"; enlist "\t") 0:system "mysql -u root -e 'select \"string\" str, time(now()) time, 99 short from dual' "
str      time         short
---------------------------
"string" 15:55:11.000 99  
 

q)meta test
c    | t f a
-----| -----
str  | C   
time | t   
short| h