Kali-Linux on microSD for Rasperry Pi 3

https://docs.kali.org/kali-on-arm/install-kali-linux-arm-raspberry-pi For Mac-book-pro and raspberry-Pi 3 Download Kali-Linux from https://www.offensive-security.com/kali-linux-arm-images/ under the RasperryPi Foundation section. It should appear in your downloads directory as kali-2017.2-rpi3-nexmon.img.xz Unzip this with, $ gunzip kali-2017.2-rpi3-nexmon.img.xz This should create the image file kali-2017.2-rpi3-nexmon.img Insert microSD card, use an adaptor if you don’t have a slot for it. I used a 16GB…Read More

Angular2+ jsPDF and html2canvas File Generation

To generate pdf files in Angular2+ (specifically angular4), first install jspdf $ npm install jspdf Then install typings for jspdf, $ npm install –save @types/jspdf Import jspdf into app.component.ts import * as jsPDF from ‘jspdf’; Add a download button to app.component.html which calls the dowload() function, <button (click)=”download()” class=”btn btn-warning btn-sm”>Download results</button> Using jspdf in…Read More

Angular 4 & D3.js

Code is on github on d3graph repo. View demo on gh-pages. Having angular-cli installed (how to install angular-cli), then create a project called ‘angular-d3-example’ $ ng new angular-d3-example Next we’ll add a component for the graph, which we’ll call ‘d3graph’, $ ng g c d3graph Add the selector to the app.component.html file. We need to…Read More

Angular 4: Simple Routing

All code is on github https://github.com/shanegibney/angular-routing A demo is available on gh-pages https://shanegibney.github.io/angular-routing/ Start a new project using angular-cli, $ ng new angularRouting Move into the project root directory $ cd angularRouting Create app-routing.module.ts $ ng g module app-routing Set the app-routing.module.ts to add components and routes. Also note the changes to ngModule imports and…Read More

Angular 4: Building a Simple Service

Create the project with angular-cli $ ng new angular-service-project Create a service with angular-cli The service was created with, $ ng g s example-service where ‘g’ is a shortcut for ‘generate’ and ‘s’ is a shortcut for ‘service’. The actual service is at: example-service-service.ts import { Injectable } from ‘@angular/core’; @Injectable() export class ExampleServiceService {…Read More

Angular4: Pass data from parent to child component (part 5)

Set  up an ng project, $ ng new angularcomponentpassing Create a new component, $ ng g c cockpit File: cockpit.component.ts import { Component, OnInit, Input } from ‘@angular/core’; @Component({ selector: ‘app-cockpit’, templateUrl: ‘./cockpit.component.html’, styleUrls: [‘./cockpit.component.css’] }) export class CockpitComponent implements OnInit { @Input(‘srvElement’) element: {name: string, id: number;} constructor() { } ngOnInit() { } }…Read More

Angular 4: Bootstrap & Components (part 2)

First install Bootstrap, $ npm install –save bootstrap Then add bootstrap to .angular-cli.json which can be found in the root of the project. Find the ‘styles’ and add the path for bootstrap like this, “styles”: [ “../node_modules/bootstrap/dist/css/bootstrap.min.css”, “styles.css” ], Then in the project root run, $ npm install, Create a component called ‘sum’ with, $…Read More

Addyosmani dotfiles

The dotfiles I use can be found on Addyosmani’s github. To install simply copy this into the terminal, (first install git) $ git clone https://github.com/addyosmani/dotfiles.git && cd dotfiles && ./sync.sh You may need to prepend this with ‘sudo’ and you may need to reboot for it to work.

GIT Notes: Remote Repositories

GIT Succinctly – free eBook from Synfusion Chapter 6 Remote Repositories Manage connections to other repositories, and list them with, $ git remote To get more information about remote repos, $ git remote -v Create a new connection to a remote repository, $ git remote add &ltuser-name&gt &ltpath-to-repo&gt Now you can reach that repo with…Read More

GIT Notes: Branches

GIT Succinctly – free eBook from Synfusion Chapter 5 Branches A new branch is a new development environment with an isolated working directory, staging and project history. ‘git branch’ is used for listing, creating, and deleting branches. To view existing branches, $ git branch The output will indicate the currently checkedout branch with an asterisk….Read More

GIT Notes: Undoing Changes

GIT Succinctly – free eBook from Synfusion Chapter 4 Undoing Changes Undoing changes in git could mean, Undo changes in working directory Undo changes in staging area Undo a entire commit Changes can be made by deleting a commit or by using a new commit to undo changes introduced by the first commit. The recent…Read More