new examples
authorChris Koeritz <fred@gruntose.com>
Fri, 3 Feb 2017 12:45:32 +0000 (07:45 -0500)
committerChris Koeritz <fred@gruntose.com>
Fri, 3 Feb 2017 12:45:32 +0000 (07:45 -0500)
plus a new function for showing md file content, and new scripts for showing network interface info and for showing packages that were manually installed.

examples/bashisms/script_location.sh
examples/building/vs_var.bat [new file with mode: 0644]
examples/graphics/pdf_picture_extractor.sh [new file with mode: 0644]
examples/os_related/block_ip_address.sh [new file with mode: 0644]
scripts/core/functions.sh
scripts/networking/interface_info.sh [new file with mode: 0644]
scripts/system/show_manually_installed.sh [new file with mode: 0644]

index a01dc95af19fa304f63ed8cd4ebbd95c83cbb527..7fa942a6302f90daba31cd31c49a686c3ef4def4 100644 (file)
@@ -5,3 +5,6 @@
 # personal aliases or functions disrupting the results.
 ORIGINATING_FOLDER="$( \cd "$(\dirname "$0")" && /bin/pwd )"
 
+# another slightly tighter version:
+export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
+
diff --git a/examples/building/vs_var.bat b/examples/building/vs_var.bat
new file mode 100644 (file)
index 0000000..de9ecc1
--- /dev/null
@@ -0,0 +1,2 @@
+
+"c:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/Tools/vsvars32.bat"
diff --git a/examples/graphics/pdf_picture_extractor.sh b/examples/graphics/pdf_picture_extractor.sh
new file mode 100644 (file)
index 0000000..bb46a0d
--- /dev/null
@@ -0,0 +1,9 @@
+var=0 
+for i in *; do
+  var=$(($var + 1))
+  mkdir -p ~/pictures_converted/$var/ 
+  pdfimages -j $i ~/pictures_converted/$var/ 
+  mv ~/pictures_converted/$var/* ~/pictures_converted/$(basename $i .pdf).jpg 
+done 
+
+
diff --git a/examples/os_related/block_ip_address.sh b/examples/os_related/block_ip_address.sh
new file mode 100644 (file)
index 0000000..68919be
--- /dev/null
@@ -0,0 +1 @@
+sudo ufw deny from ${ip_address} to any
index e2fbc519da3bfde9b509db9af28d65f51cc78c09..86d8999158c41a6f5df37ea10c13b0f219464272 100644 (file)
@@ -653,6 +653,17 @@ return 0
 
   ##############
 
+#hmmm: this points to an extended functions file being needed; not all of these are core.
+
+  # displays documentation in "md" formatted files.
+  function show_md()
+  {
+    local file="$1"; shift
+    pandoc "$file" | lynx -stdin
+  }
+
+  ##############
+
   # just shows a separator line for an 80 column console, or uses the first
   # parameter as the number of columns to expect.
   function separator()
diff --git a/scripts/networking/interface_info.sh b/scripts/networking/interface_info.sh
new file mode 100644 (file)
index 0000000..78f1f59
--- /dev/null
@@ -0,0 +1,4 @@
+
+ifc="$1"; shift
+
+nmcli device show "$ifc"
diff --git a/scripts/system/show_manually_installed.sh b/scripts/system/show_manually_installed.sh
new file mode 100644 (file)
index 0000000..0db2cdd
--- /dev/null
@@ -0,0 +1,5 @@
+
+
+#gotten from http://askubuntu.com/questions/2389/generating-list-of-manually-installed-packages-and-querying-individual-packages
+
+comm -23 <(apt-mark showmanual | sort -u) <(gzip -dc /var/log/installer/initial-status.gz | sed -n s/^Package: //p | sort -u)