Quantcast
Channel: Mandalika's scratchpad
Browsing index pages (116 articles)
↧

Shell Scripting: Tidbits #5

[1] Print the initial environment of a process strings /proc//environ This file contains the environment variables that were passed to the executable when it was started via the execve system call.[2]...

View Article


Random Linux & Shell Command Tips - rpm, ss, kill, zip

Some of these tips are applicable only on Linux. (1) List all files in an uninstalled RPMTry any of the following.rpm -qlp rpm -qilp rpm2cpio | cpio -t(2) Extracting a specific file from an RPMSteps:...

View Article


Shell Scripting: Tidbits #4

[1] Check if a String Starts with Substring or a Wildcard PatternReproducing from Advanced Bash-Scripting Guide ->Chapter 7. Tests.The == comparison operator behaves differently within a...

View Article

Shell Scripting: Tidbits #3

[1] Check if the content of file X is in another file YOne option is to rely on comm utility to compare common lines in both files. comm requires both files to be sorted.comm utility produces three...

View Article

Perl: Handling Signals

Signals are used to notify processes of a synchronous or asynchronous event. When a signal is sent, operating system interrupts the flow of execution of target process to deliver the signal. If the...

View Article


pip error: Could not find an activated virtualenv (required)

Running pip commands encounter Could not find an activated virtualenv (required) error. Some of the options to get around this error are discussed in this blog post.eg.,# pip uninstall ociERROR: Could...

View Article

Blast from the Past : The Weekend Playlist #18 — New Wave 80s

Audio & Widget courtesy: SpotifyOld Playlists:    #1   #8  #14(50s, 60s and 70s)   |    #2   #3   #4   #5(80s)   |    #6   #7   #9   #16(90s)   |    #11   #12(00s)   |    #13(10s) |...

View Article

Python Notes #1

Shuffling List ElementsTry shuffle method in random module.shuffle() modifies the original sequence. In other words, shuffling happens in place and the function returns None.To shuffle an immutable...

View Article


Shell Scripting: Few Tidbits #2

Shell Scripting Tidbits: #1Extracting the filename and extension from an absolute patheg.,Input: abspath="/var/tmp/localuserinfo.out"Filename with extension:$ basename...

View Article


Shell Scripting: Few Tidbits #1

Length of a String Stored in a Variable${#VARIABLE} eg., $ FRUIT="Orange"$ echo ${#FRUIT}6In bash, variables that store values are known as parameters. Ref: Bash Reference Manual -> Shell Parameter...

View Article

Blast from the Past : The Weekend Playlist #17 — Michael Jackson Special

The King of Pop needs no special introduction so here goes.This playlist features music from five different albums of MJ -- Off the Wall (1979), Thriller (1982; "Best-selling album" in Guinness World...

View Article

Parsing JSON on Command Line or in a Shell Script

Couple of options:1. If you do not have the flexibility of installing new utilities, or simply prefer working with existing tools, one option to consider is to make use of Python's JSON module.One or...

View Article

Blast from the Past : The Weekend Playlist #16

Audio & Widget courtesy: SpotifyOld playlists:    #1   #8  #14(50s, 60s and 70s)   |    #2   #3   #4   #5(80s)   |    #6   #7   #9(90s)   |    #11   #12(00s)   |    #13(10s) |    #10(Instrumental)...

View Article


Perl: Enabling Features

By default new features are not enabled in Perl mainly to retain backward compatibility. Starting with release 5.10, latest features have to be enabled explicitly before using them. Here are a few ways...

View Article

Python Object Persistence Module, pickle — Quick Notes

Pickling or serialization is the process of converting a Python object to a byte stream; and Unpickling or deserialization is the process of re-creating the original in-memory Python object (not...

View Article


Python Lambda Functions - Quick Notes

Lambda functions: are anonymous functions with no function name but with function body or definition are useful when a small function is expected to be called once or just a few times are useful as...

View Article

Blast from the Past : The Weekend Playlist #15 — Cirque Du Soleil Special

This edition is dedicated to Cirque du Soleil, the entertainment group with many successful live shows under their belt. Live original music accompanies almost all of Cirque's carefully choreographed...

View Article


Programming in C: Few Tidbits #8

1) Function PointersSimilar to a variable declared as pointer to some data type, a variable can also be declared to be a pointer to a function. Such a variable stores the address of a function that can...

View Article

Oracle SuperCluster: Brief Introduction to osc-interdom

Target audience: Oracle SuperCluster customersThe primary objective of this blog post is to provide some related information on this obscure tool to inquisitive users/customers as they might have...

View Article

Random Solaris & Shell Command Tips — kstat, tput, sed, digest

The examples shown in this blog post were created and executed on a Solaris system. Some of these tips and examples are applicable to all *nix systems.Digest of a FileOne of the typical uses of...

View Article
Browsing index pages (116 articles)


Latest Images