Update/upgrade your localhost WordPress without FTP

I started my Blogging career with WordPress using my localhost using LAMPP on my Ubuntu Laptop.

Also on localhost you come once in a while to a point where you need or want to update or upgrade your theme, plugins or WordPress 😉

It took me hours to come to the point to realize that I do not need a FTP-Server on my machine. Now that I know the solution, it looks not only really easy – it IS really easy!

You can do directly-“ftp” by add a single setting within the wp-config.php file.

define('FS_METHOD', 'direct');

All you need on to is to ensure WordPress can write to your local /www/ directory;-)

Cheers

Ubuntix

Mirror your Blog using ‘wget’

Sometimes you want to have your “How to…” section as offline resource with you, so that you can take and view it without internet access.
As wget was my preferred choice since late 1990 and early 2000’s I wanted to ensure I do save my brain once again.

Simple way is:

wget --mirror http://your-site.whatever

The more powerful & “I am no longer a greenhorn” way is to do it like this:

wget --mirror --convert-links --adjust-extension --page-requisites --no-parent http://your-site.whatever

As I need an explanation of the various options:

  • --mirror – the download will be recursive
  • --convert-links – The links to files that have been downloaded by wget will be changed to refer to the file they point to as a relative link
  • --adjust-extension – If a file of type application/xhtml+xml or text/html is downloaded and the URL does
    not end with the regexp \.[Hh][Tt][Mm][Ll]?, this option will cause the suffix .html to be appended to the local filename, same as for files of type text/css end in the suffix .css
  • --page-requisites – This option causes wget to download all the files that are necessary to properly display a given HTML page. This includes such things as inlined images, sounds, and referenced stylesheets
  • --no-parent – it guarantees that only the files below a certain hierarchy will be downloaded.

How to copy a directory with all subfolder/files to a new destination

  • Option A
    You can copy the content of a folder /theme to another existing folder /Theme with the command

    cp -a /theme/. /Theme/

    The -a option is a recursive option, that help you keep all file attributes.

    The . at end of the source path is a specific cp syntax that allow you to copy all files and (sub-)folders, included hidden ones.

  • Option B
    You can use cpio for this action.

    # find /theme | cpio -vdump /Theme

    Options -v = verbose dump = ensure all files inclusive all correct rights and permissions are copied.

Have Fun,
Ubuntix

How to modify the “Proudly powered by WordPress” footer…

Have you ever wondered if the “Proudly powered by WordPress” footer could be changed to some more individual?

I think I got a solution. Well, at least temporarily – until new Updates are applied, or I found a new “How to … clone a theme” entry in my brain 😉

To remove the text in the footer you will need to go to the footer.php file in the theme folder (wp-content/themes/<theme-name> and modify the lines …

<div class=”site-info”>
<?php do_action( ‘twentythirteen_credits’ ); ?>
<a href=”<?php echo esc_url( __( ‘http://wordpress.org/’, ‘twentythirteen’ ) ); ?>” title=”<?php esc_attr_e( ‘Semantic Personal Publishing Platform’, ‘twentythirteen’ ); ?>”><?php printf( __( ‘Proudly powered by %s’, ‘twentythirteen’ ), ‘WordPress’ ); ?></a>
</div><!– .site-info –>

Keep you updated …

Cheers

Ubuntix

 

Reference (added April 13th, 2015):

https://codex.wordpress.org/Function_Reference/do_action
https://codex.wordpress.org/Function_Reference/wp_footer

Conky – my default performance meter

My conky version is configured like this on my Ubuntu 14.04.X

Conky 1.9.0 compiled Wed Feb 19 18:44:57 UTC 2014 for Linux 3.2.0-37-generic (x86_64)

Compiled in features:

System config file: /etc/conky/conky.conf
Package library path: /usr/lib/conky

 X11:
 * Xdamage extension
 * XDBE (double buffer extension)
 * Xft
 * ARGB visual

 Music detection:
 * Audacious
 * MPD
 * MOC
 * XMMS2

 General:
 * math
 * hddtemp
 * portmon
 * Curl
 * RSS
 * Weather (METAR)
 * Weather (XOAP)
 * wireless
 * support for IBM/Lenovo notebooks
 * nvidia
 * eve-online
 * config-output
 * Imlib2
 * apcupsd
 * iostats
 * ncurses
 * Lua

 Lua bindings:
 * Cairo
 * Imlib2

Continue reading Conky – my default performance meter

How to remove old/unused kernel images from system

 

$ dpkg –list | grep linux-image

# dpkg –list | grep linux-headers

ii linux-headers-3.11.0-13 3.11.0-13.20 all Header files related to Linux kernel version 3.11.0

ii linux-headers-3.11.0-13-generic 3.11.0-13.20 i386 Linux kernel headers for version 3.11.0 on 32 bit x86 SMP

ii linux-headers-generic 3.11.0.13.14 i386 Generic Linux kernel headers

ii linux-headers-generic-pae 3.11.0.13.14 i386 Transitional package

rc linux-image-extra-3.8.0-19-generic 3.8.0-19.30 amd64 Linux kernel image for version 3.8.0 on 64 bit x86 SMP

rc linux-image-extra-3.8.0-21-generic 3.8.0-21.32 amd64 Linux kernel image for version 3.8.0 on 64 bit x86 SMP

rc linux-image-extra-3.8.0-22-generic 3.8.0-22.33 amd64 Linux kernel image for version 3.8.0 on 64 bit x86 SMP

Note the “rc” and “ii” in the dpkg output.

rc – package removed, cnfig files remain

ii – package installed

 

In respect to ‘rc’ .. Removed but Config files remain:

While there is no built in way to remove all of your configuration information from your removed packages you can remove all configuration data from every removed package with the following command.

Code:

dpkg -l | grep ‘^rc’ | awk ‘{print $2}’ | xargs dpkg –purge

 

After I finished, I ran /usr/sbin/update-grub just to be safe.

 

I use this script to clear my kernels

 

#/bin/bash

ls /boot/ | grep vmlinuz | sed ‘s@vmlinuz-@linux-image-@g’ | grep -v `uname -r` > /tmp/kernelList

for I in `cat /tmp/kernelList`

do

aptitude remove $I

done

rm -f /tmp/kernelList

update-grub

 

Validation steps:

$ ls /boot/ | grep vmlinuz

vmlinuz-3.11.0-13-generic

vmlinuz-3.8.0-33-generic

$ ls /boot/ | grep vmlinuz | sed ‘s@vmlinuz-@linux-image-@g’

linux-image-3.11.0-13-generic

linux-image-3.8.0-33-generic

$ ls /boot/ | grep vmlinuz | sed ‘s@vmlinuz-@linux-image-@g’ | grep -v `uname -r`

linux-image-3.8.0-33-generic

$ uname -r

3.11.0-13-generic

How to install Xubuntu / Xfce as a replacement for Gnome Unity in Ubuntu 13.10

Open

 

sudo apt-get install xubuntu-desktop gksu leafpad synaptic

Press Enter. Type your password. Your password will remain entirely invisible. not even dots will show, this is normal. Press Enter again.

 

– In the login window, click on the Ubuntu logo next to your user name. Select Xubuntu Session.

 

– Enter your password and press Enter. Now the Xubuntu desktop appears! It doesn’t look pretty yet: darkish and gloomy, with probably a lot of icons on the desktop. But all that is easily changeable (more about that that later on).

 

First: the Great Cleanup!

 

C. Cleanup

 

– Now it’s time for cleanup, in order to prevent system pollution problems. Click on the mouse icon (top left) – Accessories – Terminal Emulator

 

Type (use copy/paste, that’s both easier and safer):

 

Ubuntu 13.10:

sudo apt-get remove nautilus gnome-power-manager compiz compiz-gnome unity unity-* unity8* hud zeitgeist zeitgeist-core python-zeitgeist libzeitgeist* activity-log-manager-common gnome-control-center gnome-screenshot

sudo apt-get autoremove

 

Press Enter. Type your password. Your password will remain entirely invisible, not even dots will show, this is normal. Press Enter again.

 

In Ubuntu 13.10 you’re almost done now; reboot your computer (full reboot) and you can head straight on to lots of tips for tweaking, tuning and beautifying Xubuntu that can be found here https://sites.google.com/site/easylinuxtipsproject/xubuntu#TOC-TIPS-FOR-XUBUNTU

 

Now an intensive operation is being launched; simply wait.

 

 

B. Log in to Xubuntu

 

– When the installation is complete: log out of Ubuntu. Note: log out, don’t shut down!

 

Wer braucht denn schon ‘ne FireWall

… wenn er iptables haben kann 🙂

So, bevor Ihr weiterlest, bitte erstmal den Link zur Ubuntu Help Seite für Iptables klicken und lesen. Wer das verstanden hat braucht eigentlich
gar nicht mehr weiterlesen.

Warum?

Weil dort die Grundlagen sowie ein paar ganz wichtige Regeln für eingehenden Traffic für User wie mich beschrieben sind. Und wenn ich das kapiere
kapierst Du – Ja genau Du, der Leser dieses Blog’s – das auch. Basta!

Also wollen wir uns mal mit meiner iptables befassen.

Grundgedanke:
"Alles was von innen initiiert wird ist erlaubt" + 
"Alles was von aussen initiert wird, wird silent drop erfahren" + 
"ssh von aussen erlaubt" + 
"Möglichkeit der Protokollierung, für debug Zwecke"

Continue reading Wer braucht denn schon ‘ne FireWall

Paketlisten erzeugen/restaurieren

… kann manchmal ganz schön wichtig werden. Denken wir nur mal an das Thema Backup und Restore.

Also erster Schritt, Paketliste erzeugen:

dpkg --get-selections | awk '!/deinstall|purge|hold/ {print $1}' > /your/path-to/packages.list

Dies hilft insbesondere wenn man nach einer Neuinstallation die gleichen Pakete wieder installieren will 😉

Wer schlau ist packt /your/path-to/ mit ins Backup rein, bzw läßt vor jedem Backup den obigen Befehl laufen.

Packetliste zu Restorezwecken einsetzen

Um alle in der erzeugten /your/path-to/packages.list gespeicherten Pakete zu installieren, bzw. als einen der ersten “restore-Schritte” hilft uns:
# xargs -a "packages.list" sudo apt-get instal
extrem gut.