C

Capone

Use Python to make the first field of a text file uppercase:


#!/usr/bin/python3
import sys,re
for line in sys.stdin:
    word=line.split()
    word1=re.split("\s",line)[0]
    word1=word1.upper()
    print(str(word1)," ".join(word[1:]),end=" ")
    print()

 

Column

Format a .CSV file in columns like a spreadsheet:

column asteroids.csv -t -s ","

Coal Creek Falls at Cougar Mountain Regional Wildland Park in the heart of Seattle suburbia.

Concalc

Contours 

#! /usr/bin/python3
import matplotlib.pyplot as plt
import numpy as np
X,Y = np.meshgrid(np.linspace(-4,4,512),np.linspace(-4,4,512))
Z=(1-X/2+X**4+Y**3)*np.exp(-X**2-Y**2)*(1-X/3-Y**4)*(3-Y+X**2)
levels=np.linspace(np.min(Z),np.max(Z),20)
fig,ax=plt.subplots()
ax.contour(X,Y,Z,levels=levels)
plt.show()

Convert between numerical bases:

#! /bin/bash
printf "hex2dec=";echo "ibase=16;$1"|bc
printf "dec2hex=";echo "obase=16;$1"|bc
printf "oct2dec=";echo "ibase=8;$1"|bc
printf "dec2oct=";echo "obase=8;$1"|bc

convert (imagemagick)

convert big-e.jpg -resize 50% little-e.jpg

 

curl

Weather report in the console, any time:

$ curl wttr.in/seattle