Sunday, 21 January 2018

Handy app to Sync photos from Android phone to Linux Ubuntu

SyncThing for Android app: https://syncthing.net/

How to install SyncThing on Ubuntu: https://www.linuxbabe.com/ubuntu/install-syncthing-ubuntu-16-04-via-official-deb-repository

And then add it to the Ubuntu menu bar or as a link to the desktop: https://askubuntu.com/questions/31427/how-do-i-put-a-web-application-on-the-launcher  

----

Install Syncthing on Ubuntu 16.04 via Official Deb Repository

Use curl to download the Syncthing GPG key then import the key to Ubuntu system with apt-key.

sudo apt-get install curl 

curl -s https://syncthing.net/release-key.txt | sudo apt-key add -
 
-s option enables silent mode.

If you see OK in the terminal, that means the GPG key is successfully imported. Then add official Syncthing deb repository with the following command.

echo "deb http://apt.syncthing.net/ syncthing release" | sudo tee /etc/apt/sources.list.d/syncthing.list

Update local package index and install Syncthing on Ubuntu 16.04 LTS.
 
sudo apt-get update 

sudo apt-get install syncthing

This deb repository also works on Debian or other Debian/Ubuntu-based Linux distros such as Linux Mint, Elementary OS.

Set Up Syncthing as a Systemd Service

The official Syncthing deb package ships with the needed systemd service file. Under /lib/systemd/system/ directory, you will find a syncthing@.service file. Enable syncthing to auto start when Ubuntu is booted up by running the below command. Replace username with your actual username.

sudo systemctl enable syncthing@username.service

The above command will create a symbolic link that points to the syncthing@.service file.

Created symlink from /etc/systemd/system/multi-user.target.wants/syncthing@linuxbabe.service to /lib/systemd/system/syncthing@.service.
Now we can start the Syncthing service with the following command.

sudo systemctl start syncthing@username.service
 
Check status

systemctl status syncthing@username.service
 
Output:
● syncthing@linuxbabe.service - Syncthing - Open Source Continuous File Synchronization for linuxbabe
   Loaded: loaded (/lib/systemd/system/syncthing@.service; enabled; vendor preset: enabled)
   Active: active (running) since 六 2016-06-04 17:16:20 CST; 31s ago
     Docs: man:syncthing(1)
 Main PID: 5586 (syncthing)
   CGroup: /system.slice/system-syncthing.slice/syncthing@linuxbabe.
service
    └─5586 /usr/bin/syncthing -no-browser -no-restart -logflags=0
 
We can see that Syncthing auto start is enabled and it’s running. Now in your Web browser’s address bar, type 127.0.0.1:8384 to access the Syncthing Web interface. You can add other Syncthing devices and share folders with them. The default syncing folder is ~/Sync

Friday, 5 January 2018

Ubuntu 16.04 - how to read external USB/Sata hard drive that has old encrypted Home folder

Ubuntu 16.04 - how to read external USB/Sata hard drive that has old encrypted Home folder

Terminal commands

To avoid permissions error:

umount /run/user/1000/gvfs

Then:

sudo ecryptfs-recover-private 

Then follow the prompts - see screen-shot below...






Tuesday, 18 September 2012

getting original xbox dvd dongle to work with Ubuntu 12.04

This guide is mostly copied and pasted from these two fantastic posts:  http://ubuntuforums.org/showpost.php?p=11422009&postcount=19 and http://forum.xbmc.org/showthread.php?tid=98348

Just follow the instructions and input the lines of code into a terminal...
--------------------------------------------------------------------------------------------------------------------

...got it going, I just compiled the xbox driver rather than all of lirc

Code:
sudo gedit /etc/modprobe.d/blacklist.conf
add 'blacklist xpad' without the quotes to the bottom of the file


Code:
sudo update-initramfs -u
sudo apt-get build-dep lirc
sudo apt-get install git dialog automake autoconf libtool
git clone git://lirc.git.sourceforge.net/gitroot/lirc/lirc
wget http://old.nabble.com/attachment/31787507/0/lirc_0.9.1_lirc_xbox_driver.patch
cd lirc/
patch -p1 <../lirc_0.9.1_lirc_xbox_driver.patch
gedit drivers/lirc_xbox/lirc_xbox.c
remove (i.e., delete the whole line or this will mess things up) the line


#include <linux smp_lock.h="smp_lock.h">


Code:
./autogen.sh
./configure -with-driver=userspace
cd drivers/lirc_xbox/
make
sudo make install
sudo apt-get install lirc
edit
 sudo gedit /etc/lirc/hardware.conf
 to use lirc_xbox as the remote module so it looks like this:
# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="Windows Media Center Transceivers/Remotes (all)"
REMOTE_MODULES="lirc_xbox"
REMOTE_DRIVER=""
REMOTE_DEVICE="/dev/lirc0"
REMOTE_SOCKET=""
REMOTE_LIRCD_CONF="mceusb/lircd.conf.mceusb"
REMOTE_LIRCD_ARGS=""

#Chosen IR Transmitter
TRANSMITTER="None"
TRANSMITTER_MODULES=""
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE=""
TRANSMITTER_SOCKET=""
TRANSMITTER_LIRCD_CONF=""
TRANSMITTER_LIRCD_ARGS=""

#Enable lircd
START_LIRCD="true"

#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD="false"

#Try to load appropriate kernel modules
LOAD_MODULES="true"

# Default configuration files for your hardware if any
LIRCMD_CONF=""

#Forcing noninteractive reconfiguration
#If lirc is to be reconfigured by an external application
#that doesn't have a debconf frontend available, the noninteractive
#frontend can be invoked and set to parse REMOTE and TRANSMITTER
#It will then populate all other variables without any user input
#If you would like to configure lirc via standard methods, be sure
#to leave this set to "false"
FORCE_NONINTERACTIVE_RECONFIGURATION="false"
START_LIRCMD=""
- Backup /etc/lirc/lircd.conf
sudo gedit /etc/lirc/lircd.conf
and replace with this:
Code:

# brand: Microsoft Xbox DVD Receiever (also works with generic)
# remote control: Xbox remote or any remote using RCA DVD player codes

begin remote

  name  XboxDVDDongle
  bits            8
  eps            30
  aeps          100

  one             0     0
  zero            0     0
  gap          163983
  toggle_bit_mask 0x0

      begin codes
          LEFT                     0xA9
          UP                       0xA6
          RIGHT                    0xA8
          DOWN                     0xA7
          SELECT                   0x0B
          1                        0xCE
          2                        0xCD
          3                        0xCC
          4                        0xCB
          5                        0xCA
          6                        0xC9
          7                        0xC8
          8                        0xC7
          9                        0xC6
          0                        0xCF
          MENU                     0xF7
          DISPLAY                  0xD5
          REWIND                   0xE2
          FFWD                     0xE3
          PLAY                     0xEA
          PAUSE                    0xE6
          STOP                     0xE0
          SKIP-                    0xDD
          SKIP+                    0xDF
          TITLE                    0xE5
          INFO                     0xC3
          BACK                     0xD8
      end codes

end remote

Tuesday, 14 June 2011

Links to Useful Web Dev Resources

'Would you like to display your own icon on the browser address bar and browser tabs when visitors view your web pages?

'Now it's easy to create icons and marquees for your web pages with FavIcon from Pics. Simply select a picture, logo or other graphic (of any size/resolution) for the "Source Image" and click "Generate FavIcon.ico'
http://www.chami.com/html-kit/services/favicon/

Thinking Web: Voices of the Community - free to download PDF book.
http://blogs.sitepoint.com/thinking-web-voices-of-the-community/

"The 960 Grid System is an effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem."
http://960.gs/

rose is so lovely

Wednesday, 12 January 2011

XBOX DVD IR Remote, Ubuntu 10.10 and irxevent

Get the Xbox DVD IR reciver and remote working on Ubuntu - follow this post: http://forum.xbmc.org/showpost.php?p=688677&postcount=32

The remote should now work with XBMC. To get the Remote working with other applications...

1) Install irxevent

- System> Administration> Synaptic Package Manager> lirc-x

2) Create the irxevent confic file in home folder

- Create a new document in home folder and rename it .lircrc
- Right click on the file and in Permissions tab tick the allow executable tick box.
- Open the file with the text editor and paste the following in the file, then save and close.

begin
prog = irxevent
button = SELECT
repeat = 0
config = Key KP_Enter CurrentWindow
end
begin
prog = irxevent
button = MENU
repeat = 3
config = Key Tab CurrentWindow
end
begin
prog = irxevent
button = BACK
repeat = 0
config = Key alt-Left CurrentWindow
end
begin
prog = irxevent
button = LEFT
repeat = 2
config = Key Left CurrentWindow
end
begin
prog = irxevent
button = RIGHT
repeat = 2
config = Key Right CurrentWindow
end
begin
prog = irxevent
button = UP
repeat = 2
config = Key Up CurrentWindow
end
begin
prog = irxevent
button = DOWN
repeat = 2
config = Key Down CurrentWindow
end

- Run the command irxevent -d in the Terminal (to restart run killall irxevent
and then irxevent -d)

Map more buttons by checking sudo gedit /etc/lirc/lircd.conf to find out the button label (ie. button = DOWN) and then map it to a keyboard key (ie. the Enter key KP_Enter). More info here: http://tv-true.org/how-to/configuring-lirc.html and here: http://www.youtube.com/watch?v=e9O6Qm5nWwo

To start irxevent whenever Firefox is started create a script and then a new Firefox short that uses the script to start Firefox.

- Create a new file called ffir.bin and copy the script text:

#!/bin/bash
irxevent -d
firefox

- Save the script (remember to make the file make executable).
- Right click on the new Firefox short-cut and open Properties and then change the Command field to Desktop/ffir.bin.

Thursday, 16 December 2010

Getting PHP mail function to work on localhost (my computer)

I set up Apache and installed PHP 5 on my laptop computer running Linux/Ubuntu 10.10, but I couldn't get locally (localhost) run scripts to send emails. Following both the links below (bits from both) got things working. NOTE: for the root email I put my usually email, ie. smith@gmail.com.

http://www.davidhurst.co.uk/2007/06/19/php-mail-and-ssmtp-on-debian-linux/

http://tombuntu.com/index.php/2008/10/21/sending-email-from-your-system-with-ssmtp/