This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: run the script like ./myssh 3 or if you want list of options ./myssh | |
# Written by Jon Nikolakakis with help from Jamie Bainbridge, Version 0.1 | |
# Change the knownUserloc entry to match your username | |
# Example: knownUserloc="/home/jnuser" | |
knownUserloc="/root" | |
HOSTFILE="$knownUserloc/.ssh/known_hosts" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat /etc/wpa_supplicant/wpa_supplicant.conf | |
ctrl_interface=/var/run/wpa_supplicant | |
ctrl_interface_group=wheel | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
void prompt(); | |
int main() | |
{ | |
char hostname[1024]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This is an example taken from a book, one day I might need to reference this so I thought I would save it, | |
it uses many different techniques in c such as: | |
- adding modules | |
- create global variables using constsants and local variables inside functions | |
- setting up prototyes for functions | |
- defining different types such as long int, char | |
- loops inside functions | |
- different style of comments | |
- break out of loop | |
- if statements */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <ctype.h> | |
int main() | |
{ | |
char selector; | |
float height_in_feet,inches; | |
int weight,age,pounds,height_in_cm,bmr; | |
int choc = 230; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
/* Australian Tax Rates verified with https://www.ato.gov.au/Calculators-and-tools/Host/?anchor=STC&anchor=STC#STC/questions */ | |
int myearnings(void); | |
int main() | |
{ | |
int unsigned long earnings,tax1,tax2,tax0; | |
int unsigned deftax[] = {0,3572,19822}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
declare -a arr | |
# List all interfaces and assign it to the Variable DEV, then get the current ring buffer settings for each interface | |
# Create its own seperate file, so we can manipulate the output | |
# assign each of the output into an array | |
for DEV in $(ip a l | grep mtu | awk '{print $2}' | awk -F ":" '{print $1}'| egrep -v "^lo|virbr*|bond*|*team") | |
do | |
ethtool -g $DEV 2>/dev/null > eth_$DEV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
filename=/tmp/$(hostname -f).out | |
rm -f $filename | |
journalctl --since "now" -f >> $filename& | |
#for ((n=0;n<5;n++)) | |
echo "Script is running, press \"cntrl c\" to stop" | |
while true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Lets break the full command down | |
ip -o link show eth0 | awk '{ for (x=1; x<=NF;x++) if ($x=="link/ether") print $(x+1)}' | |
############################################################ | |
# If we just run the ip -o link command against regular, it just adds the ip link into one line. | |
This is useful if you want to awk after | |
ip -o link show eth0 | |
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000\ link/ether 00:1a:4a:16:01:86 brd ff:ff:ff:ff:ff:ff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### First version 0.000001 | |
#!/bin/bash | |
# confirm version Rhel 5, 6, 7 and switch version and commands based upon this. For test purposes this is for Rhel 6 | |
########## RHEL 6 ########################################### | |
# Verify rpm | |
cd /var/lib/rpm | |
/usr/lib/rpm/rpmdb_verify Packages |
NewerOlder