Chit chat

=======

Happy valentines day.

Screenshot - 02162015 - 11:27:33 AM

 

More fun than old fashioned wrestling.

 

 

——————————————–

Our goal here to see what is live on the network and how possibly vunerable those machines are. Might be interesting to use with a wifi network.

First lets get the live systems at the moment. You will need to change your code depending on your network,

alive.sh

 #!/bin/bash
rm goodips
is_alive_ping()
{
  ping -c 1 $1 > /dev/null
  [ $? -eq 0 ] && echo $i >> goodips
}

for i in 192.168.1.{1..255}
do
is_alive_ping $i & disown
done

Generated goodips file:
192.168.1.1
192.168.1.32
192.168.1.99
192.168.1.126

Then we can run a sort of network scanner.

scannet.sh

datafile="goodips"
a=1
m="not done"
while read line
do fdata[$a]=$line
echo $line
        let a=a+1
       for p in {1..1023};
       do
       (echo >/dev/tcp/$line/$p) >/dev/null 2>&1 && echo "$p open"
       done
done < $datafile

Then we can run the bash file to see what is open. (You could also save it to a file.)

192.168.1.1
23 open
53 open
80 open

192.168.1.32
22 open
80 open
110 open
111 open
143 open
443 open
993 open
995 open

192.168.1.99
21 open
80 open
139 open
515 open

192.168.1.126
22 open
25 open
80 open
139 open
445 open

——————————————–

Replace traditional command to install ssh-keys
cat ~/.ssh/id_rsa.pub | ssh usr@host’cat >> .ssh/authorized_keys’

With a single command:
ssh-copy-id -i ~/.ssh/id_rsa.pub user@host

SSH-COPY-ID(1) BSD General Commands Manual SSH-COPY-ID(1)

NAME
ssh-copy-id — use locally available keys to authorise logins on a remote
machine

SYNOPSIS
ssh-copy-id [-n] [-i [identity_file]] [-p port] [-o ssh_option]
[user@]hostname
ssh-copy-id -h | -?

DESCRIPTION
ssh-copy-id is a script that uses ssh(1) to log into a remote machine
(presumably using a login password, so password authentication should be
enabled, unless you’ve done some clever use of multiple identities). It
assembles a list of one or more fingerprints (as described below) and
tries to log in with each key, to see if any of them are already installed
(of course, if you are not using ssh-agent(1) this may result in you being
repeatedly prompted for pass-phrases). It then assembles a list of those
that failed to log in, and using ssh, enables logins with those keys on
the remote server. By default it adds the keys by appending them to the
remote user’s ~/.ssh/authorized_keys (creating the file, and directory, if
necessary). It is also capable of detecting if the remote system is a
NetScreen, and using its ‘set ssh pka-dsa key …’ command instead.

The options are as follows:

-i identity_file
Use only the key(s) contained in identity_file (rather than look‐
ing for identities via ssh-add(1) or in the default_ID_file). If
the filename does not end in .pub this is added. If the filename
is omitted, the default_ID_file is used.

Note that this can be used to ensure that the keys copied have the
comment one prefers and/or extra options applied, by ensuring that
the key file has these set as preferred before the copy is
attempted.

-n do a dry-run. Instead of installing keys on the remote system
simply prints the key(s) that would have been installed.

-h, -? Print Usage summary

-p port, -o ssh_option
These two options are simply passed through untouched, along with
their argument, to allow one to set the port or other ssh(1)
options, respectively.

Rather than specifying these as command line options, it is often
better to use (per-host) settings in ssh(1)’s configuration file:
ssh_config(5).

Default behaviour without -i, is to check if ‘ssh-add -L’ provides any
output, and if so those keys are used. Note that this results in the com‐
ment on the key being the filename that was given to ssh-add(1) when the
key was loaded into your ssh-agent(1) rather than the comment contained in
that file, which is a bit of a shame. Otherwise, if ssh-add(1) provides
no keys contents of the default_ID_file will be used.

The default_ID_file is the most recent file that matches: ~/.ssh/id*.pub,
(excluding those that match ~/.ssh/*-cert.pub) so if you create a key that
is not the one you want ssh-copy-id to use, just use touch(1) on your pre‐
ferred key’s .pub file to reinstate it as the most recent.

EXAMPLES
If you have already installed keys from one system on a lot of remote
hosts, and you then create a new key, on a new client machine, say, it can
be difficult to keep track of which systems on which you’ve installed the
new key. One way of dealing with this is to load both the new key and old
key(s) into your ssh-agent(1). Load the new key first, without the -c
option, then load one or more old keys into the agent, possibly by ssh-ing
to the client machine that has that old key, using the -A option to allow
agent forwarding:

user@newclient$ ssh-add
user@newclient$ ssh -A old.client
user@oldl$ ssh-add -c
… prompt for pass-phrase …
user@old$ logoff
user@newclient$ ssh someserver

now, if the new key is installed on the server, you’ll be allowed in
unprompted, whereas if you only have the old key(s) enabled, you’ll be
asked for confirmation, which is your cue to log back out and run

user@newclient$ ssh-copy-id -i someserver

The reason you might want to specify the -i option in this case is to
ensure that the comment on the installed key is the one from the .pub
file, rather than just the filename that was loaded into you agent. It
also ensures that only the id you intended is installed, rather than all
the keys that you have in your ssh-agent(1). Of course, you can specify
another id, or use the contents of the ssh-agent(1) as you prefer.

Having mentioned ssh-add(1)’s -c option, you might consider using this
whenever using agent forwarding to avoid your key being hijacked, but it
is much better to instead use ssh(1)’s ProxyCommand and -W option, to
bounce through remote servers while always doing direct end-to-end authen‐
tication. This way the middle hop(s) don’t get access to your
ssh-agent(1). A web search for ‘ssh proxycommand nc’ should prove
enlightening (N.B. the modern approach is to use the -W option, rather
than nc(1)).

SEE ALSO
ssh(1), ssh-agent(1), sshd(8)

BSD February 15, 2015 BSD

——————————————–

Couple of cartoons:

More input (aka short circuit)

Screenshot from 2015-03-04 09:33:16

Can you hear me now?

Screenshot from 2015-03-04 11:16:14

Proper inkjet repair.

Screenshot from 2015-03-02 23:24:31

——————————————–

$ cal 2015
                            2015
      January               February               March          
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  
             1  2  3   1  2  3  4  5  6  7   1  2  3  4  5  6  7  
 4  5  6  7  8  9 10   8  9 10 11 12 13 14   8  9 10 11 12 13 14  
11 12 13 14 15 16 17  15 16 17 18 19 20 21  15 16 17 18 19 20 21  
18 19 20 21 22 23 24  22 23 24 25 26 27 28  22 23 24 25 26 27 28  
25 26 27 28 29 30 31                        29 30 31              

       April                  May                   June          
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  
          1  2  3  4                  1  2      1  2  3  4  5  6  
 5  6  7  8  9 10 11   3  4  5  6  7  8  9   7  8  9 10 11 12 13  
12 13 14 15 16 17 18  10 11 12 13 14 15 16  14 15 16 17 18 19 20  
19 20 21 22 23 24 25  17 18 19 20 21 22 23  21 22 23 24 25 26 27  
26 27 28 29 30        24 25 26 27 28 29 30  28 29 30              
                      31                                          

        July                 August              September        
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  
          1  2  3  4                     1         1  2  3  4  5  
 5  6  7  8  9 10 11   2  3  4  5  6  7  8   6  7  8  9 10 11 12  
12 13 14 15 16 17 18   9 10 11 12 13 14 15  13 14 15 16 17 18 19  
19 20 21 22 23 24 25  16 17 18 19 20 21 22  20 21 22 23 24 25 26  
26 27 28 29 30 31     23 24 25 26 27 28 29  27 28 29 30           
                      30 31                                       

      October               November              December        
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  
             1  2  3   1  2  3  4  5  6  7         1  2  3  4  5  
 4  5  6  7  8  9 10   8  9 10 11 12 13 14   6  7  8  9 10 11 12  
11 12 13 14 15 16 17  15 16 17 18 19 20 21  13 14 15 16 17 18 19  
18 19 20 21 22 23 24  22 23 24 25 26 27 28  20 21 22 23 24 25 26  
25 26 27 28 29 30 31  29 30                 27 28 29 30 31        

eddie@debian:~$ ./cal 2015
                                      2015

            January                 Februray                 March        
      Su Mo Tu We Th Fr Sa    Su Mo Tu We Th Fr Sa    Su Mo Tu We Th Fr Sa
                   1  2  3     1  2  3  4  5  6  7     1  2  3  4  5  6  7
       4  5  6  7  8  9 10     8  9 10 11 12 13 14     8  9 10 11 12 13 14
      11 12 13 14 15 16 17    15 16 17 18 19 20 21    15 16 17 18 19 20 21
      18 19 20 21 22 23 24    22 23 24 25 26 27 28    22 23 24 25 26 27 28
      25 26 27 28 29 30 31                            29 30 31 

             April                    May                     June        
      Su Mo Tu We Th Fr Sa    Su Mo Tu We Th Fr Sa    Su Mo Tu We Th Fr Sa
                1  2  3  4                    1  2        1  2  3  4  5  6
       5  6  7  8  9 10 11     3  4  5  6  7  8  9     7  8  9 10 11 12 13
      12 13 14 15 16 17 18    10 11 12 13 14 15 16    14 15 16 17 18 19 20
      19 20 21 22 23 24 25    17 18 19 20 21 22 23    21 22 23 24 25 26 27
      26 27 28 29 30          24 25 26 27 28 29 30    28 29 30 
                              31                      

              July                   August                September      
      Su Mo Tu We Th Fr Sa    Su Mo Tu We Th Fr Sa    Su Mo Tu We Th Fr Sa
                1  2  3  4                       1           1  2  3  4  5
       5  6  7  8  9 10 11     2  3  4  5  6  7  8     6  7  8  9 10 11 12
      12 13 14 15 16 17 18     9 10 11 12 13 14 15    13 14 15 16 17 18 19
      19 20 21 22 23 24 25    16 17 18 19 20 21 22    20 21 22 23 24 25 26
      26 27 28 29 30 31       23 24 25 26 27 28 29    27 28 29 30 
                              30 31                   

            October                 November                December      
      Su Mo Tu We Th Fr Sa    Su Mo Tu We Th Fr Sa    Su Mo Tu We Th Fr Sa
                   1  2  3     1  2  3  4  5  6  7           1  2  3  4  5
       4  5  6  7  8  9 10     8  9 10 11 12 13 14     6  7  8  9 10 11 12
      11 12 13 14 15 16 17    15 16 17 18 19 20 21    13 14 15 16 17 18 19
      18 19 20 21 22 23 24    22 23 24 25 26 27 28    20 21 22 23 24 25 26
      25 26 27 28 29 30 31    29 30                   27 28 29 30 31 

Of course you can run the cal command, but would it not be nice to see what went into it.

Cal.c
#include
#include
#include

int width = 80, year = 1969;
int cols, lead, gap;

const char *wdays[] = { “Su”, “Mo”, “Tu”, “We”, “Th”, “Fr”, “Sa” };
struct months {
const char *name;
int days, start_wday, at;
} months[12] = {
{ “January”, 31, 0, 0 },
{ “Februray”, 28, 0, 0 },
{ “March”, 31, 0, 0 },
{ “April”, 30, 0, 0 },
{ “May”, 31, 0, 0 },
{ “June”, 30, 0, 0 },
{ “July”, 31, 0, 0 },
{ “August”, 31, 0, 0 },
{ “September”, 30, 0, 0 },
{ “October”, 31, 0, 0 },
{ “November”, 30, 0, 0 },
{ “December”, 31, 0, 0 }
};

void space(int n) { while (n– > 0) putchar(‘ ‘); }

void init_months()
{
int i;

if ((!(year % 4) && (year % 100)) || !(year % 400))
months[1].days = 29;

year–;
months[0].start_wday
= (year * 365 + year/4 – year/100 + year/400 + 1) % 7;

for (i = 1; i 4) gap = 4;
lead = (width – (20 + gap) * cols + gap + 1) / 2;
year++;
}

void print_row(int row)
{
int c, i, from = row * cols, to = from + cols;
space(lead);
for (c = from; c < to; c++) {
i = strlen(months[c].name);
space((20 – i)/2);
printf(“%s”, months[c].name);
space(20 – i – (20 – i)/2 + ((c == to – 1) ? 0 : gap));
}
putchar(‘\n’);

space(lead);
for (c = from; c < to; c++) {
for (i = 0; i < 7; i++)
printf(“%s%s”, wdays[i], i == 6 ? “” : ” “);
if (c < to – 1) space(gap);
else putchar(‘\n’);
}

while (1) {
for (c = from; c < to; c++)
if (months[c].at < months[c].days) break;
if (c == to) break;

space(lead);
for (c = from; c < to; c++) {
for (i = 0; i < months[c].start_wday; i++) space(3);
while(i++ < 7 && months[c].at < months[c].days) {
printf(“%2d”, ++months[c].at);
if (i < 7 || c < to – 1) putchar(‘ ‘);
}
while (i++ <= 7 && c < to – 1) space(3);
if (c < to – 1) space(gap – 1);
months[c].start_wday = 0;
}
putchar(‘\n’);
}
putchar(‘\n’);
}

void print_year()
{
int row;
char buf[32];
sprintf(buf, “%d”, year);
space((width – strlen(buf)) / 2);
printf(“%s\n\n”, buf);
for (row = 0; row * cols < 12; row++)
print_row(row);
}

int main(int c, char **v)
{
int i, year_set = 0;
for (i = 1; i < c; i++) {
if (!strcmp(v[i], “-w”)) {
if (++i == c || (width = atoi(v[i])) < 20)
goto bail;
} else if (!year_set) {
if (!sscanf(v[i], “%d”, &year) || year = 20)]\n”, v[0]);
exit(1);
}

But the you could add a picture:
$ cat snoopycal.sh
echo ” ,-~~-.___. —-”
echo ” / ()=(() \\ $1 $2″
echo ” ( ( 0 —-”
echo ” \\._\\, ,—-‘”
echo ” ##XXXxxxxxxx”
echo ” / —‘~;”
echo ” / /~|-”
echo ” =( ~~ |”
echo ” /~~~~~~~~~~~~~~~~~~~~~\\”
echo ” /_______________________\\”
echo ” /_________________________\\”
echo “/___________________________\\”
echo ” |____________________|”
echo ” |____________________|”
echo ” |____________________|”
echo ” | |”
echo “”
cal $1 $2

Which could result in:

$ ./snoopycal.sh 3 2015
,-~~-.___. —-
/ ()=(() \ 3 2015
( ( 0 —-
\._\, ,—-‘
##XXXxxxxxxx
/ —‘~;
/ /~|-
=( ~~ |
/~~~~~~~~~~~~~~~~~~~~~\
/_______________________\
/_________________________\
/___________________________\
|____________________|
|____________________|
|____________________|
| |

March 2015
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31

Screenshot from 2015-03-17 14:14:30

——————————————–

Gimp does not have the liquid command but it dies have distorts iwarp.

Screenshot from 2015-03-17 14:52:40 Screenshot from 2015-03-17 14:53:29

Screenshot from 2015-03-17 14:55:07Screenshot from 2015-03-17 15:00:06

——————————————–

Had a video that I made, but wanted the audio separate just to listen to it. So I did

$ avconv -i inputfile.flv  outputfile.mp3

Then copied the file over to the music server.

Screenshot from 2015-03-17 15:30:15

——————————————–

Getting Flash files:

Go to the page with the flash file you would like to get at and the show the source.

Screenshot from 2015-03-17 16:31:45

The get the file:

$ wget http://www.mydr.com.au/babies-pregnancy/animation-fertilisation-of-egg-by-sperm/files/images/animations/fertilisation.swf

Play it with your viewer.

——————————————–

Just a big snoopy.

$ fbc snoopy.bas

$ ../snoopy

Screenshot from 2015-03-17 17:01:04

——————————————–

Screenshot from 2015-03-18 22:57:32

Remark: Logic for a sous vide system

Set lo

w_temperature

Set high_temperature

Set start_time

Set end_time

Turn on heat

Turn on led

if end_time < start_time then stop.

loop until time > end_time.

Get temperature

if temperature > high_temperature then turn off heat and turn off led

if temperature < low_temperature then turn on heat and turn on led

get time

loop

turn led off

end

 

——————————————–

Focaccia sort of

pizza

Good day.

Advertisements