Hello World Python3, Bash, C, C++, Go, Lua, Ruby, Java – Programming Languages on Ubuntu 18.04

Hello world! All programs start with a hello world. It tests that your environment is working, so that you can run your code. This is how you install and run the most important languages on Linux: Python 3, Bash, C, … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , , , , | Leave a comment

CPU Usage Percent – Python One-Liner for Load Average per CPU

Processor usage is 88%. But how do I get a number like this? For gurus, this Python one-liner prints CPU usage $ python3 -c “print(‘{:.0f}%’.format( float(‘$(cat /proc/loadavg)’.split()[0]) / float(‘$(nproc)’)*100 ) )” 12% The rest of us can read on how … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , , , | Leave a comment

Send Email with HTTP API – curl, ctrl-X E and Sendgrid API

Use interactive console and HTTP requests to access APIs. Here is an example of automatic mail sending with SendGrid and curl.

Posted in Uncategorized | Tagged , , , , | Leave a comment

Short Bash prompt – export PS1=”\W\$ “

You can have a nice, deep directory stucture – and still keep your prompt short and tidy.

Posted in Uncategorized | Tagged , , | Leave a comment

Shell Scripting

< ![CDATA[showTocToggle("+","-")]]>Table of Contents Shell Scripting Hello world – lspwd See also Shell Scripting Shell scripting automates repeating actions. It is reliable, used in server startup scripts in Linux. It is fast to use, simply write the same commands as … Continue reading

Posted in Old Site | Tagged , , , | 3 Comments

aboutusers

  #!/bin/bash # aboutusers – print information about human users # (Actually a bash shell scripting example program) # (c) 2006-03-06 Tero Karvinen www.iki.fi/karvinen # GNU General Public License version 2   for DIR in /home/* do USER=$(basename $DIR); echo … Continue reading

Posted in Old Site | Tagged , , , | 1 Comment
  • Recent Posts

  • Picks

  • Boxing Clock for AndroidOcton8 Diving T-ShirtsShaking Tower Panda Android GameLearn Chinese with Android
  • Student projects