
Welcome to Coding-School.com old school! Some of the tips, techniques and code freely imparted here, I’ve searched the web previously and come back...
aws ec2 describe-instances | jq -cr ‘.Reservations[].Instances[0]|[.InstanceId,.InstanceType,.KeyName,.State,.Tags]’ # list instances aws ec2...
aws elbv2 describe-load-balancers| jq -c ‘.LoadBalancers[]|[.LoadBalancerName,.LoadBalancerArn]’ # list arns aws elbv2 describe-listeners –load-balancer-arn...
Connect to mongodb: $ mongo show dbs; db.<collection>.stats(1024000000) # gb – ref db.<collection>.find({},{<field>:<value>}).sort({<field>:1}).limit(5);...
How to produce a digest of tables using nodetool $ nodetool tablestats | awk ‘ /Keyspace/ || /Latency/ {print $0} /Table:/ {gsub(/^[ ][ ]/,””);table=”–>...
One of the first things you are probably going to want to do is use modules. For example to print out pi, we use the math module as below import mathmath.pi...
How to quickly paste into R and get some results on a Mac (just change pipe/paste for diff OS) df<-read.table(pipe("pbpaste"),sep=" ")names(df)<-c("date","time","count")df$dtg<-strptime(paste(df$date,df$time,sep="...
I have been working with Python and spent many hours of study, but best way to learn is to teach 🙂 As per my other guides into PHP, Perl, etc .. I will...
Just having a play with ruby and thought I’d try to simulate summary(x): irb(main):001:0> y=[]irb(main):002:0> def x();rand(9999);end;=> :xirb(main):003:0>...
HowTo: clone from a gitlab server running inside a docker container Ensure SSH pubkey is setup by following https://docs.gitlab.com/ee/ssh/ Check source...
I have created demo code with Jupyter Notebook, which can be viewed here: https://github.com/marcuspaget/pythonDSFromScratch/blob/master/PandasDemo.md...
Good use of R’s tapply function to summary data .. ## read a csv file into a table called x – the first row contains column names x<-read.table("2014-tax.csv",sep=",",header=T)...
Whilst on 5 week long service leave – created my first Arduino Hack to control an LCD (Liquid Crystal Display) I had lying around for last 6 years...
Sample code for working with Python Dicts # init users list of dicts, print out id 1, then init friends list of tuples users = [ { "id": 0, "name": "Bob"...
In recent years it has become necessary to learn Powershell. This is for a number of reasons, but predominately because certain automations are only possible...
Introduction to Perl Perl is an acronym, short for Practical Extraction and Report Language. It was designed by Larry Wall as a tool for writing programs...
“Having studied Data Science since April 2014, felt it a good time to get to know Rstudio’s Shiny Server! So sourced data.gov.au’s Disaster...
Nice piece of work on recent browsers resilience and dns round robin
Perl Signals Perl allows you to trap signals using the %SIG associative array. Using the signals you want to trap as the key, you can assign a subroutine...
Perl DBI Example The DBI module enables your Perl applications to access multiple database types transparently. You can connect to MySQL, MSSQL, Oracle,...
Perl OOP Why Object Oriented approach? A major factor in the invention of Object-Oriented approach is to remove some of the flaws encountered with the...
Perl File operations Variables which represent files are called “file handles”, and they are handled differently from other variables. They...
Perl Regular Expressions Metacharacters char meaning ^ beginning of string $ end of string . any character except newline * match 0 or more times + match...
Perl Subroutine sub mysubroutine { print "Not a very interesting routinen"; print "This does the same thing every timen"; } regardless of any parameters...
Perl References I’m happiest writing Perl code that does not use references because they always give me a mild headache. Here’s the short version...
The if…else Statement This statement uses a relational expression to check the validity of a condition and execute a set of statements enclosed in...
The Loop Statements Different loop statements in perl… The for Loop The foreach Loop The while Loop The do-while Loop The until Loop The process...
@ARGV and %ENV The built-in array @ARGV contains the command line arguments for a Perl program. The following run of the Perl program critic.pl will have...
Perl Hash Maps/associative arrays ASSIGNING HASH VALUES hash tables consist of key/value pairs every key is followed by a value values can be assigned...
Arrays @ Array constants are specified using parenthesis ( ) and the elements are separated with commas. Perl arrays are like lists or collections in other...
SEARCH