Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions bash-functions/bash_functions.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@

encryptfile()
{
if [ -z "$1" ]
then
echo 'Usage: encryptfile filename...';
if [ -z "$1" ]
then
echo 'Usage: encryptfile filename...';
else
openssl aes-256-cbc -a -salt -in $1 -out "$1.enc"
fi
}

decryptfile()
{
if [ -z "$1" ]
if [ -z "$1" ]
then
echo 'Usage: decryptfile filename...';
echo 'Usage: decryptfile filename...';
else
echo 'Enter filename after decryption...'
read f
Expand All @@ -39,7 +39,7 @@ if [ -z $1 ]; then
printf "%s\nShredding and removing file ${filename} ...\n"
shred --iterations=7 --remove ${filename}
[ $? = 0 ] && printf "%s\nFile ${filename} has been securely removed.\n"
return 0
return 0
done
fi
}
Expand All @@ -48,7 +48,7 @@ secure-file()
{
if [ -z "$1" ]; then
printf "%s\n" "Usage: enter edit or view, followed by filename."
return 5
return 5
elif [ -z "$2" ]; then
printf "%s\n" "ERROR: Missing filename argument. Please re-check..."
return 5
Expand All @@ -63,44 +63,44 @@ local GPGUSER=$(whoami) # Current user running this function
case ${ACTION} in

view)
if [ ! -f $2 ]; then
if [ ! -f $2 ]; then
printf "%s\n" "File ${SECRET} does not appear to exist. Please check the filename again."
return 1
else
clear; gpg2 --decrypt ${WORKDIR}/${SECRET}
fi
;;

edit)
if [ ! -f $2 ]; then
if [ ! -f $2 ]; then
printf "%s\n" "File ${SECRET} does not appear to exist. Please check the filename again."
return 1
else
clear; gpg2 --output ${WORKDIR}/${CLEAR} --decrypt ${WORKDIR}/${SECRET}
local HASH=$(md5sum ${WORKDIR}/${CLEAR} | cut -d " " -f1) # Create hash before editing

vi ${WORKDIR}/${CLEAR}
local NEWHASH=$(md5sum ${WORKDIR}/${CLEAR} | cut -d " " -f1) # Create hash after editing

if [ ${HASH} = ${NEWHASH} ]; then # Check whether or not the decrypted file was changed
clear; printf "%s\n" "ATTENTION: File was not modified, removing decrypted file: ${WORKDIR}/${CLEAR}"
sleep 4
secure-remove ${WORKDIR}/${CLEAR} # Remove decrypted file securely
return 0
return 0
fi

clear; gpg2 -r ${GPGUSER} --output ${WORKDIR}/${SECRET} --encrypt --armor ${WORKDIR}/${CLEAR}
clear; printf "%s\n" "SUCCESS: File was modified and re-encrypted, removing decrypted file: ${WORKDIR}/${CLEAR}"
sleep 4
secure-remove ${WORKDIR}/${CLEAR} # Remove decrypted file securely
return 0
fi
;;

*)
printf "%s\n" "Try again..."
esac

}

## Function to remove packages installed today
Expand All @@ -125,7 +125,7 @@ copy-my-key()
}

## Git Functions
git-add()
git-add()
{
[ -z "$1" ] && return
set -x
Expand Down
2 changes: 1 addition & 1 deletion config-files/70-persistent-net.rules-by-PCI-bus-ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x100e (e1000)
# SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:d1:f 7:cc", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# udevadm info --query=all --path=/sys/class/net/eth0
Expand Down
80 changes: 40 additions & 40 deletions config-files/apt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
last line) a completely valid file. Most of the options have sane default
values, unless you have specific needs you should NOT include arbitrary
items in a custom configuration.

In some instances involving filenames it is possible to set the default
directory when the path is evaluated. This means you can use relative
paths within the sub scope.

The configuration directives are specified in a tree with {} designating
a subscope relative to the tag before the {}. You can further specify
a subscope using scope notation eg,
Expand All @@ -20,7 +20,7 @@
quiet "0";

// Options for APT in general
APT
APT
{
// Architecture "i386";
// Build-Essential "build-essential";
Expand All @@ -29,18 +29,18 @@ APT
// considered for autoRemove

// Options for apt-get
Get
Get
{
Arch-Only "false";
AllowUnauthenticated "false";
AutomaticRemove "false";
AutomaticRemove "false";
HideAutoRemove "false";
Download-Only "false";
Simulate "false";
Assume-Yes "false";
Force-Yes "false"; // I would never set this.
Fix-Broken "false";
Fix-Missing "false";
Fix-Broken "false";
Fix-Missing "false";
Show-Upgraded "false";
Show-Versions "false";
// Upgrade "true";
Expand All @@ -59,7 +59,7 @@ APT
Show-User-Simulation-Note "true";
};

Cache
Cache
{
Important "false";
AllVersions "false";
Expand All @@ -72,7 +72,7 @@ APT
Installed "false";
};

// CDROM
// CDROM
// {
// Rename "false";
// NoMount "false";
Expand Down Expand Up @@ -106,7 +106,7 @@ APT

// install recommends automatically for packages in this section
Install-Recommends-Section { "metapackages"; "universe/metapackages"; };

// consider dependencies of packages in this section manual
Never-MarkAuto-Sections {"metapackages"; "universe/metapackages"; };

Expand All @@ -127,30 +127,30 @@ APT

// APT::Archives::MaxAge "0"; (old, deprecated)
MaxAge "0"; // (new)
// - Set maximum allowed age of a cache package file. If a cache
// - Set maximum allowed age of a cache package file. If a cache
// package file is older it is deleted (0=disable)

// APT::Archives::MinAge "2"; (old, deprecated)
MinAge "2"; // (new)
// - Set minimum age of a package file. If a file is younger it
// will not be deleted (0=disable). Usefull to prevent races
// will not be deleted (0=disable). Usefull to prevent races
// and to keep backups of the packages for emergency.

// APT::Archives::MaxSize "0"; (old, deprecated)
MaxSize "0"; // (new)
// - Set maximum size of the cache in MB (0=disable). If the cache
// is bigger, cached package files are deleted until the size
// requirement is met (the biggest packages will be deleted
// requirement is met (the biggest packages will be deleted
// first).

// Update-Package-Lists "0";
// - Do "apt-get update" automatically every n-days (0=disable)
//
//
// Download-Upgradeable-Packages "0";
// - Do "apt-get upgrade --download-only" every n-days (0=disable)
//
// Unattended-Upgrade "0";
// - Run the "unattended-upgrade" security upgrade script
// - Run the "unattended-upgrade" security upgrade script
// every n-days (0=disabled)
// Requires the package "unattended-upgrades" and will write
// a log in /var/log/unattended-upgrades
Expand All @@ -163,7 +163,7 @@ APT
// 0: no report (or null string)
// 1: progress report (actually any string)
// 2: + command outputs (remove -qq, remove 2>/dev/null, add -d)
// 3: + trace on
// 3: + trace on
};
};

Expand All @@ -180,7 +180,7 @@ Acquire
// 50% of the size of the original file

// HTTP method configuration
http
http
{
Proxy "http://proxy.internal.dom:3128";
// Proxy::http.us.debian.org "DIRECT"; // Specific per-host setting
Expand All @@ -191,7 +191,7 @@ Acquire
// Cache Control. Note these do not work with Squid 2.0.2
No-Cache "false";
Max-Age "86400"; // 1 Day age on index files
No-Store "false"; // Prevent the cache from storing archives
No-Store "false"; // Prevent the cache from storing archives
// Dl-Limit "7"; // 7Kb/sec maximum download rate
User-Agent "Debian APT-HTTP/1.3";
};
Expand All @@ -208,7 +208,7 @@ Acquire
// for more examples
// https
// {
// Proxy "https://proxy.internal.dom:3128";
// Proxy "https://proxy.internal.dom:3128";
// Verify-Peer "false";
// SslCert "/etc/apt/some.pem";
// CaPath "/etc/ssl/certs";
Expand Down Expand Up @@ -241,21 +241,21 @@ Acquire
// "USER $(SITE_USER)@$(SITE):$(SITE_PORT)";
// "PASS $(SITE_PASS)";
// };

// Timeout "120";

/* Passive mode control, proxy, non-proxy and per-host. Pasv mode
is preferred if possible */
// Passive "true";
// Proxy::Passive "true";
// Passive::http.us.debian.org "true"; // Specific per-host setting
// };

cdrom
{
// do auto detection of the cdrom mountpoint
AutoDetect "true";

// cdrom mountpoint (needs to be defined in fstab if AutoDetect is not used)
mount "/cdrom";

Expand All @@ -275,12 +275,12 @@ Acquire
mirror
{
RefreshInterval "360"; // refresh interval in minutes
MaxAge "90"; // max age for a mirror file in days before
MaxAge "90"; // max age for a mirror file in days before
// it gets deleted
// mirror failure reporting script
ProblemReporting "/usr/lib/apt/apt-report-mirror-failure";
ProblemReporting "/usr/lib/apt/apt-report-mirror-failure";
// mirror failure reporting url
ReportFailures "http://example.com/mirror-failure";
ReportFailures "http://example.com/mirror-failure";
};

CompressionTypes
Expand All @@ -297,7 +297,7 @@ Acquire
Dir "/"
{
// Location of the state dir
State "var/lib/apt/"
State "var/lib/apt/"
{
Lists "lists/";
xstatus "xstatus";
Expand All @@ -306,16 +306,16 @@ Dir "/"
cdroms "cdroms.list";
mirrors "mirrors/";
};

// Location of the cache dir
Cache "var/cache/apt/" {
Archives "archives/";
// backup directory created by /etc/cron.daily/apt
Backup "backup/";
Backup "backup/";
srcpkgcache "srcpkgcache.bin";
pkgcache "pkgcache.bin";
pkgcache "pkgcache.bin";
};

// Config files
Etc "etc/apt/" {
Main "apt.conf";
Expand All @@ -330,7 +330,7 @@ Dir "/"
Trusted "trusted.gpg";
TrustedParts "trusted.gpg.d";
};

// Locations of binaries
Bin {
methods "/usr/lib/apt/methods/";
Expand All @@ -349,23 +349,23 @@ Dir "/"
History "history.log";
};

// Media
Media
// Media
Media
{
// Media AutoDetect mount path
MountPath "/media/apt";
};

// Media
Media
// Media
Media
{
// Media AutoDetect mount path
MountPath "/media/apt";
};
};

// Things that effect the APT dselect method
DSelect
DSelect
{
Clean "auto"; // always|auto|prompt|never
Options "-f";
Expand Down Expand Up @@ -406,19 +406,19 @@ DPkg
MaxBytes 1024;
MaxArgs 350;

// controls if apt will apport on the first dpkg error or if it
// controls if apt will apport on the first dpkg error or if it
// tries to install as many packages as possible
StopOnError "true";
}

/* Options you can set to see some debugging text They correspond to names
of classes in the source code */
Debug
Debug
{
pkgProblemResolver "false";
pkgProblemResolver::ShowScores "false";
pkgDepCache::AutoInstall "false"; // what packages apt install to satify dependencies
pkgDepCache::Marker "false";
pkgDepCache::Marker "false";
pkgCacheGen "false";
pkgAcquire "false";
pkgAcquire::Worker "false";
Expand Down
Loading