Recent Updates Page 2 Toggle Comment Threads | Keyboard Shortcuts

  • Jay Versluis 8:29 pm on July 6, 2014 Permalink | Reply
    Tags: , ,   

    Categories: Commodore ( 13 )

    How to set the time on your Commodore C64 / C128 

    Commodore LogoDid you know that the Commodore computers had a built-in clock? It wasn’t an exact science, and it didn’t show the date, but it was able to display a 24hr clock.

    It did this by counting how many seconds your machine was switched on, accessible in two variables TI and TI$ (short for TIME).

    TI$ is a string value in the format HHMMss, counting seconds. 112347 would mean 11:23am and 47 seconds. TI$ will be 000000 when you switch on the system. You can set it just like any other variable to set the time:

    TI$ = "094500"
    

    TI counts the number of 60th seconds since the system was switched on (don’t ask):

    print int(ti/60);" seconds since startup"
    

    Both values reset when you reset the system. Like all internal computer clocks it is relatively accurate, but does drift a second or two per day (we don’t notice this on modern systems because those talk to an NTP server once every day and sync themselves).

    TI and TI$ are present on the C64, C128, Plus/4 and many other Commodore variants.

     
  • Jay Versluis 1:15 pm on July 3, 2014 Permalink | Reply  
    Categories: MySQL ( 15 )

    How to find and replace in MySQL 

    Sometimes you need to change some text in a MySQL table. For example, imagine you want to correct a spelling mistake or a reference in all your WordPress posts without having to change them one by one.

    Here’s how to do it with a raw SQL command. This works only on a single table – repeat this for each table:

    update `wp_posts`
    set `post_content` = replace(post_content, 'Old Text', 'New Text')
    

    Note the use of standard ticks and back ticks here. First we’ll select the table in question (in this case wp_posts), then we’ll issue the find and replace query by selecting the column in the table (post_content), followed by the replace command.

    As soon as MySQL comes back all references will have changed from “Old Text” to “New Text”.

    Careful here: there is no undo function! Once executed, all changes are live instantly. Make a backup copy of your database before you do anything!

     
  • Jay Versluis 1:05 pm on July 3, 2014 Permalink | Reply  
    Categories: WordPress ( 83 )

    How to avoid 500 Internal Server Errors when using the WordPress Importer 

    wordpress-iconI’ve used the WordPress Importer on many occasions – most of which gave me more grief than results. Usually I end up with a white screen telling me that there was an “Internal Server Error”. It basically means that something went wrong, but nobody knows what it was – and there is no way to find out.

    While entertaining ideas of finding another hobby, I searched the web one last time to sift through the hundreds of posts by other users sharing the same woes – until I came across this forum post by Anon who had the same problem:

    Anon did not give up so easily and found a solution which WORKS GREAT – even though it doesn’t make sense, or is in any way documented:

    Rather than simply importing the XML file you receive from Tools – Export, turn this file into a GZIP file, and then import it.

    I have no idea why this works, but I’ve just tried it with WordPress 3.9.1 and it works like a charm. On a Mac, simply

    • open Terminal
    • type “gzip ” (with a space)
    • then drag the file in question into the Terminal session
    • this will paste the full path of that file

    Hit return and you have a .gz file. The original file is deleted automatically.

    You can also do this from the command line like this:

    gzip yourfile.xml
    

    Anon suggests that if you’re a Windows user you can use 7zip to create a .gz file.

     
  • Jay Versluis 12:53 pm on June 30, 2014 Permalink | Reply
    Tags:   

    Categories: WordPress ( 83 )

    How to swap the post title and date in P2 

    wordpress-iconI’ve just posted this tweak in the WordPress P2 forum to help a user and thought I’d add it here too before I forget what I did.

    To swap the post title and date in P2 we’ll first grab a reference to each element, then we move one up and the other down.

    Like so:

    /* swap post title and date */
    #main h4 {
      margin-top: 30px;
      margin-bottom: 15px;
    }
    #main .postcontent h2 {
      margin-top: -65px;
    }
    

    Note that the date line does not have a selector for the author, so it’s difficult to remove it if that’s required. You can remove the entire line though (#main h4).

    Add padding where appropriate.

     
  • Jay Versluis 6:16 am on June 30, 2014 Permalink | Reply
    Tags: ,   

    Categories: iOS, Podcast ( 218 )

    How to use iCloud in your iOS App 

    In this series I’ll show you how to use iCloud in your iOS apps. We’ll discuss how to setup Xcode and your app, including App ID and Provisioning Profiles and I’ll demonstrate how to use all three flavours of iCloud: Key Value Storage, Document Storage and iCloud with Core Data.

    The rest of this series is for members of my iOS Dev Diary only – you can watch it here: http://pinkstone.co.uk/how-t-use-icloud-in-your-ios-apps/

    Enjoy!

     
  • Jay Versluis 7:12 am on June 28, 2014 Permalink | Reply
    Tags: , ,   

    Categories: Linux ( 45 )

    How to enable Touchpad Taps as Mouse Clicks on your NC10 in CentOS 

    CentOS-LogoThe NC10′s integrated Synaptics Touch Pad works out of the box in CentOS 6, both under GNOME and KDE. No drivers or patches requried.

    But I remember that when it was running Windows XP I could “tap” the pad instead of clicking the dedicated key (that loud CLACK noise annoys the neighbours). How can we bring this behaviour to CentOS?

    A quick serach reveals this post by Russel in the CentOS forum:

    his suggests that a configuration file needs to be created somewhere. However I found that there’s an easier solution which – at least on the NC10 – works with just one click. I assume this will work for other latops too:

    • head over to System – Preferences – Mouse
    • select the Toucpad tab at the top
    • tick the box “enable mouse clicks with touchpad”
    • works instantly

    Tourpad-Taps

     
  • Jay Versluis 11:39 am on June 27, 2014 Permalink | Reply
    Tags:   

    Categories: Linux ( 45 )

    How to add a CentOS user to the sudoers list 

    CentOS-LogoWhen you try to prefix a command with sudo on a fresh CentOS system you may be greeted with a message such as “you are not part of the sudoers list” and that the incident will be reported. Not the the FBI, but to a log file. And of course your sudo operation isn’t going to work.

    That’s because individual users to the system need to be granted permission to executer root level commands, even if it’s only temporary. Here’s how to do it.

    In essence, you need to add your user to a file called sudoers which lives in /etc/sudoers on CentOS 6.5. This file is read only, even to the root user – so before tweaking it we need to change its permissions, otherwise your edits can’t be saved:

    chmod 666 /etc/sudoers

    Now use your favourite text editor and find the following section:

    vi /etc/sudoers
    
    ...
    
    ## Next comes the main part: which users can run what software on
    ## which machines (the sudoers file can be shared between multiple
    ## systems).
    ## Syntax:
    ##
    ##     user    MACHINE=COMMANDS
    ##
    ## The COMMANDS section may have other options added to it.
    ##
    ## Allow root to run any commands anywhere
    root    ALL=(ALL)     ALL
    youruser ALL=(ALL)  ALL
    

     

    Add your own user name underneath the root user (as shown above), then save the file and exit. Don’t forget to change the file permissions back to 440 just like they were before:

    chmod 440 /etc/sudoers

     

     
  • Jay Versluis 4:41 am on June 26, 2014 Permalink | Reply
    Tags: , Dropbox,   

    Categories: Linux ( 45 )

    How to install Dropbox on CentOS 6.5 (from source) 

    Dropbox-LogoBeing the sport that I am I thought I’d install Dropbox from source on my NC10. Even though an rpm installer package is available, I do enjoy a challenge.

    My laptop is cunnrently running CentOS 6.5 (32bit) and has GNOME installed.

    Turns out I needed a couple of packages – and before I forget, here’s how I did it. We’ll do all this from the command line (you have to be root for this):

    Pick the latest .tar file from here https://linux.dropbox.com/packages/, then download it with

    wget https://linux.dropbox.com/packages/nautilus-dropbox-1.6.2.tar.bz2

    Extract and enter the directory it produces:

    tar -xjf nautilus*
    cd nautilus-dropbox-1.6.2
    

    At this point the following sequence of commands should build the project:

    ./configure
    make
    make install
    

    However on my system I received an error message after ./configure, letting me know that I needed the libnautilus-extension and docutils packages. I installed them with

    yum install docutils nautilus-devel
    

    Once installed, make and make install worked fine.

    Now Dropbox is installed but it’s not running or configured. Let’s do that next:

    dropox start -i
    

    This will start the daemon and prompt you to download the desktop client from the GUI which will allow you to login and sync your content, just like on Windows and Mac.

     
    • lsatenstein 10:25 am on June 26, 2014 Permalink | Reply

      I guess it’s the challenge to do the non rpm installation, and you enjoy it.

      I just downloaded the Fedora version and subsequently did sudo yum install ./nautilus…. .

      Yum resolved the “Need to have issue”

      In doing the setup, did you find a way to delay dropbox startup after a user logs in to his computer account? I frequent hot spots with my laptop, where the laptop needs wi-fi access before any communication can occur. Dropbox, in this situation, gets in the way, impeding the webbrowser logon to the wifi network. Of course, once the wifi security is resolved, dropbox is able to work.

      • Jay Versluis 9:25 am on June 27, 2014 Permalink | Reply

        Indeed, at times and in moderation. 90% of the time I’m a yum man myself ;-)

        Yes I know what you mean about the immediate Dropbox connection, I have this problem myself. I don’t know of a way to delay the initial connection, I usually just right-click on the Dropbox symbol in the top bar and select “quit Dropbox” which stops the syncing process unti I reboot or manually start Dropbox again.

        Likewise, I have machines on which I’ve disabled the Dropbox auto start (in the same dialogue box), usually when I know this machine won’t be connected to a fast connection for long and otherwise would interfere with quick sessions. This approach works well on all platforms and is identical on Windows and Mac.

        Not the answer you’re looking for I know – but an easy workaround.

  • Jay Versluis 1:35 pm on June 25, 2014 Permalink | Reply
    Tags: , ,   

    Categories: Linux ( 45 )

    How to install GNOME on your Samsung NC10 (CentOS 6.5) 

    CentOS-LogoWith the WiFi card on my NC10 enabled, I struggled to connect to my actual WiFi network from the command line (WPA2). After an entire day of research, trial and error I had to admit to myself that setting this up on a minimal CentOS 6 installation is simply beyond me.

    Likewise, monitoring the levels of my new battery had me greatly puzzled.

    But those two points aside, I also wanted to install a Desktop type environment on my NC10 so it would be more useful – now that it has a new battery and all.

    As it turns out installing GNOME – almost as a side effect – will take care of both those problems in a flash: easily connecting the NC10 to my WiFi network, monitoring my battery, and so much more.

    Let me show you how I did it.

    My machine has a minimal CentOS 6.5 installation on it and I’ve installed the Atheros driver as explained in my previous article. I’m on a wired network connection to install the additional GNOME packages.

     

    yum groupinstall

    I didn’t know this but yum is even more magical than I always thought: not only can it install single packages and resolve their dependencies; yum can also install entire sets of packages called groups.

    To see what’s available type

    yum grouplist

    This will show you a huge list of available and installed groups. We’re interested in the following:

    • Desktop
    • Desktop Platform
    • X Window System
    • Fonts
    • Internet Browser

    To install all those without being asked for every group, type

    yum -y groupinstall "Desktop" "Desktop Platform" "X Window System" "Fonts" "Internet Browser"

    Since groups can have spaces in their names it is necessary to put them into “quotes” . Once issued, yum will go to work. This will take some time so let’s grab coffee.

    Thanks to the Vagabond Geek and Jeff Hunter for the above info.

    Using GNOME by default

    Now that my NC10 is more of a laptop rather than a remote web server, I like the idea of booting into the desktop environment by default. To do this tweak a single number in /etc/inittab:

    // to edit the file 
    vi /etc/inittab
    
    // change this line 
    id:3:initdefault:
    
    // to 
    id:5:initdefault:

    Above this line you’ll see an explanation of what each ID will do at boot time. Realistically you’ll only ever need to worry about 3 and 5. Save the file and restart your system – and upon next boot you’re prompted to create a new user, or login with existing credentials.

    Change it back anytime you like.

     

    NC10 – meet GNOME

    I had looked at GNOME many years ago on an old and long retired slow Sony Vaio laptop – and was surprised how relatively slick it runs on the NC10′s underpowered hardware.

    To my surprise things like the integrated Samsung Function keys for screen backlight and volume were working out of the box without the need for additional drivers or patches! Just like the touchpad – it just works. Same with monitoring my battery level.

    Bravo, CentOS! Here’s what the NC10 looks like running GNOME:

    GNOME on NC10

     

    Connecting to your WiFi Network

    GNOME isn’t all that different from other desktop OSes and reminds me of Windows and Mac OS X. You connect to your local network simply by clicking the “antenna” type symbol at the top of the screen, pick your network from the list and enter the password.

    If you’ve ticked the relevant box, you’ll be connected automatically on subsequent logins.

     

    Why CentOS on the NC10? Why not use Windows?

    My NC10 came with Windows XP back in 2009 when I first bought it – because Vista was such a joke and nobody wanted it.

    Later models of the NC10 came with Windows 7, but 2GB of RAM are highly recommended – and mine only has 1 GB. “Recommended” doesn’t mean that the experience is going to be great though. Windows 8 isn’t even an option on the NC10.

    But more importantly, XP is has ended extended support in April 2014 – and Windows 7 is going to exit mainstream support in January 2015. At the time of writing that’s in 6 months.

    CentOS 6 will be around until 2020 and copes extremely well with the NC10′s hardware.

     

    I’m confused: X11, GNOME, KDE… what’s all this?

    You and me both, brother! As I understand it, GNOME and KDE are both desktop systems that show you a graphical user interface (GUI) – much like Windows and Mac OS X. They both look slightly different and are developed by different teams.

    X11 is the actual engine that allows apps to interact with content in windows. This wasn’t always the case, especially in the early age of computers which were text and column based. X11 is a breakthrough and allows for processing to happen on a remote machine, while graphics are rendered on the local system.

    As with many things in Linux, you have a choice of which GUI you’d like to run: GNOME or KDE. You can even install both on your system and boot into the one you fancy:

    yum -y groupinstall "KDE Desktop"

    Or, from GNOME, head over to System – Administration – Add/Remove Software and search for KDE, then install it from there.

    Once the install is complete, log out (top right) and log back in, selecting your desired interface from the drop down at the bottom. Here’s what it looks like on the NC10:

    KDE-NC10

    Both systems get the job done and it really comes down to personal preferences and needs.

    GNOME is a more “barebones”, while KDE contains accessories like a calculator, games, different web browser and a whole lot of other stuff by default.

    I found that on the NC10 I much prefer GNOME over KDE – perhaps because GNOME reminds me of Mac and KDE of Windows. As I said, it’s really about personal taste.

     

    Further Reading

     
  • Jay Versluis 6:49 pm on June 23, 2014 Permalink | Reply
    Tags: ,   

    Categories: Linux ( 45 )

    How to enable WiFi on your Samsung NC10 under Centos 6.x 

    NC10When I installed CentOS on my NC10 last year I did so knowing that its battery was bust. Since it wasn’t going to live without a power supply, I didn’t setup WiFi at the time – the NC10 being tied to one cable, I simply added another (the network cable) and that was that. Worked fine and without problems.

    Today a new battery for my NC10 arrived, breathing new (wireless) life into the little guy – and needless to say now I wanted to setup WiFi. Sadly I don’t know enough about network adaptors under CentOS, so I thought how hard can it be?

    Actually it’s easy – it’s just not very well documented on the whole wide web due to the multitude of Distribution vs Hardware configurations.

    Thanks to two great articles (by Joris and Paul - find links at the end) I managed to connect my NC10 to my WiFi network: an Apple AirPort Timecapsule. It works a treat. Thanks guys!

    I deviated a little from both articles, so here’s the “remix” which should work specifically for the Samsung NC10. I’m running CentOS 6.5 in 32bit, minimal installation without any bells or whistles, on a 1GB Intel Atom machine.

    (More …)

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel