Tag Archives: advice

Fix off screen windows in Windows 10

Do you have windows which are stuck off screen and there is no Move options in the right click menu on the taskbar, even if you hold the Shift key? Read on for a solution!

  1. Left click the app’s icon on the taskbar icon. If the app has more than one window open, click on the appropriate thumbnail.
  2. Press and hold the Alt key on your keyboard then press the spacebar and release. This will bring up a menu on one of your visible screens.
  3. Click ‘Move’ on the list, and use the cursor keys (the arrow keys) on your keyboard to move the program. The window will continue move while the key is held down. The window will usually be to the left or right of the screen where the menu popped up, but you may have to experiment to see where it is to move it back.

That it! Good luck!

Staying cool in a heatwave

I’ve been reading lots over the last little while, on how to stay cool in the current heatwave. This is all the recommendations I have. I’ll follow this up with explanations of each suggestion in another post later — writing this has taken a lot out of me! Links are for example, buy what’s available and fits your needs 🙂

The UK is not set up for heat waves of up to 40c, thousands of people will die, we may have power and water outages.

Things to do immediately

Things to do the day before the heatwave

  • Turn your fridge and freezer up — make them colder
  • Freeze bottles of water (Separately from the immediate water stock!). Old fizzy drink bottles are fine. Squeeze them a little before putting the lid on, to give the water space to expand into
    • For one of the bottles, fill it halfway up, and store in the freezer so you can get to it. When you want a cold drink, just fill it a bit, and shake. Instant cold water!
  • If you have south-facing windows, prepare to cover them. A sheet, tin foil, paper.
  • Prepare foods ready to eat cold. Tuna mayo, egg mayo for sandwiches, salads, cold meats, cook some beans ready. Consider cooking a pasta bake or similar and putting it entirely into the fridge
  • At night, open your windows:
    • If you have a multiple level house, open windows/doors on one side of your house on the bottom floor, and on the top open the windows on the other side — so air will flow in a diagonal
    • If you’re in a flat or bungalow, open the windows/doors on opposite side of the house
  • Try to stay at home, or indoors. If your office has air con, I’m jealous. Avoid heavy activity during the day
  • Cover any south facing window with tin foil / paper / baking paper / cardboard / sheets. Do this on the outside if at all possible. If you do it on the inside, you might overheat your windows, and break them. Expensive bills later!

During the heatwave

peeling warning sign

DO NOTs

Do not do any of these things. They will harm you!

  • Drink Alcohol
  • Drink too much coffee (A little to prevent withdrawal is a good idea, but give energy drinks a miss)
  • Use “Air Conditioners” that don’t have an extract hose, that you have to fill with water. They use up the indoor air ability to absorb water — and sweating is the main way you lose heat when it’s too hot, so they make you hotter and make fans work less effectively. It’s safe to use them with a window open
  • Use air conditioners with an extract hose out a window without sealing your window with these kits. Yes they’re ugly, but without them you’re literally pulling hot air in from outside!
  • Heavy exercise — including manual work — especially during the peak in the afternoon, 1200 – 2000 (12pm to 8pm)
  • Avoid cooking using the oven, or hobs whilst windows are closed. If you have to, use the microwave
  • Avoid travelling if possible. Trains will be very slow, aircon may fail. Roads may melt
Green node of traffic light

DOs

  • An hour after sunrise, or as close as possible, close your windows
    • During the heatwave, check the temperature sensor against the weather app, or your weather station. When the indoor temperature is close to the outdoor temperature, go outside a second to see if it feels cooler outside (in the shade!) than inside. If so, open the windows as recommended above — in a diagonal, or opposite side of your dwelling
  • Drink lots of water. One or two electrolyte drinks a day in the absolute peak temperature
  • If indoor temp is below outdoor temp, keep the windows closed. Make sure to open them when it’s warmer
  • Consider pointing a fan out the window once it’s time to open the windows. Use a tissue or light cloth to work out which way the natural wind is blowing air, and point the fan in the direction to work with the wind, not against it
  • Wear light, airy clothes. If you can, stick to 100% cotton, which will wick your sweat and help it evaporate, keeping you cooler
  • Wear a hat if you go outside, and remember your sunscreen — even if it’s cloudy
  • If you have cats, put out a few bowls of water, spread around the building for them to drink from
  • If you have plants, water them before the temperature peak
  • Shower with a lukewarm shower. You want the water just a little cool to the touch. Too cold, and you’ll confuse your body, too hot, and you’ll just make it worse
  • Freeze a hot water bottle. Wrap it in a towel to cool down
  • Wrap an ice pack in a towel, and hold it between your upper thighs. You have arteries there, so will cool your entire body rapidly
  • Damp a towel and put it around your neck
  • Put your feet in a bucket or large bowl of water
  • Don’t use your fans feature to have it change direction it blows air into — oscillation. You want to set up a breeze of air around your room, that’ll effectively multiply how much air is moving without needing too many fans
  • Put a bowl of ice in front of a fan
  • Damp a sheet, or wet duvet cover before sleeping
  • You can set up a fan to blow *into* a duvet cover, effectively inflating it with a constant supply of fresh air. You can use clothes pegs attach it to the fan’s grills

Comment your own tips below!

Arduino Variable Types Explained

Here’s something for reference.
I can never find just quite the succinct reference to Arduino Variable types. Nowhere could i find a list of minimum and maximum values, the bits, and the memory used by each variable type.

Neither was there any clear definition of meaning of ‘unsigned’, which just means no plus or minus signs in this type – that is all numbers positive. This increases the highest number that can be stored in the same memory. (thank me in the comments).

Usage Variable type Bits Min value Max value Ram usage Comments
common boolean 8 TRUE FALSE 1 byte
common byte 8 0 255 1 byte
char 8 -128 127 1 byte  A single ‘character’ e.g. ‘a’ is a single char.  Represented by chr(65) or the binary: 01000001
word 16 0 65535 2 byte
common int 16 -32768 32767 2 byte
unsigned long 32 0 4,294,967,295 4 byte
common long 32 -2,147,483,648 2,147,483,647 4 byte
common float 32 -3.4028235E+38 3.4028235E+38 4 byte
The below types are only included for compatibility or further study.
redundant unsigned char 8 0 255  1 byte use byte instead
redundant unsigned int 16 0 65535  2 bytes use word instead
redundant double 32 -3.4028235E+38  3.4028235E+38  4 bytes use float instead
The below types are special types (see arduino.cc)
special string variable  1 byte + x An array of chars
(used for storing strings to modify)
special enum variable  N/A Like boolean but custom fixed set of values allowed instead of TRUE/FALSE.
special struct variable  N/A Public sub variables
(as if you’d made a public class)
special pointer  N/A I’ll be honest, I wasn’t sure the use of this one. Here for completeness though!
Source: https://learn.sparkfun.com/tutorials/data-types-in-arduino
Source: https://playground.arduino.cc/Code/DatatypePractices
Remark: “Unsigned” means no negative sign. This increases the range of positive numbers available.
Remark: Unsigned variables that exceed their capacity roll over back to zero. This could be useful to iterate through arrays of limited length

PPS If anyone can figure out how to properly format this table so it looks nice, with ‘center’ aligned text, please let me know wordpress was being frustrating!

(The formatting css is in the source, see the table tag)

Find Windows workstation logon script

This is a super quick tip from an online forum…
[Sevenforums.com: Where is the location for the windows logon script?]

If you’re looking for the location of the active logon script in a Windows domain network on a workstation, or just to figure out which logon script is being used for a workstation

TLDR; ‘Get to the point, where is the bleeding thing?!’:

To find the location of a user’s logon script, while logged in as the user, run the command:
net user “%USERNAME%” | find “Logon script”
or for a domain user,
net user “%USERNAME%” /domain | find “Logon script”

Standard location

The logon scripts themselves can be found on the network in the standard domain network share location:

\\%USERDOMAIN%\netlogon

Additionally, the commands:

net user “%USERNAME%” /domain

and

gpresult /r

Give interesting results for the current user and what Group policy rules are active for the currently logged in user/(machine?) respectively.

Obviously this is only relevant to windows computers in active directory with primary domain controller and group policy ordaining that each machine should run a logon script.

 

Search Terms:

Things i searched for in order to try and find this out:

  • find out what logon script a computer is using
  • find path of logon script from workstation
  • find path of logon script from workstation registry

(I couldn’t find the registry location as it turns out!)

If this post helped you, or you have additional tips, please leave them in the comments!

Excel tip – adding two numbers where one is text

Just a quick tip as i couldn’t quickly find the answer in google.

If you have two cells of data and you want to add them when one might have text instead of a number, use the SUM function.

For instance

Class Section 1
QTY
Section 2
QTY
Totals
Robots 10,000 1,000 =sum(B2:C2)
=11,000
Humans 9,000,000,000 n/a =sum(B3:C3)
=9,000,000,000
Plants n/a n/a =sum(B4:C4)
=0

I also searched for: sum two values if isnumeric, excel add two numbers if text only include the non text and excel add two numbers if text.

Link

Just a super-quick post here.

If you’re looking for addons or plugins for Microsoft Outlook to help you organize your emails and extend the functionality of Outlook

(note Outlook is very extensible, as with all Microsoft Office applications you can write Visual Basic code for Applications to hook into it’s functions. Absaloutely fantastic for hacking excel as I have been doing for the last few weeks – my work needs to invest in a proper database program for sure *sigh*)

You’d do no better than looking here

Snapfiles Outlook Add-ons

http://www.snapfiles.com/freeware/comm/fwoutlook.html

 

They have addons that are useful – and unlike most of the sites on i’ve found so far – up to date and compatible with recent versions (2003+) of Outlook.

Hope this helps folks!

 

Mythubuntu 12.04 and Radeon 9200

Hi all, I was having trouble installing Mythubuntu 12.04 on an old PC I had lying around.
Mythubuntu is based on Ubuntu 12.04 so if you’re struggling with the ATI Radeon 9200 on there these steps should help.

(Since I have a Hauppuage Nova-T 500 dual freeview pci card from old projects, and a 2tb drive from new ones, I wanted to see about recording some films!)

Basically, when booting it would come up with a garbled, black or blank screen.

If this happens during the livecd boot, preventing you from installing, when you see the logo:

Logo that appears when first booting ubuntu from livecd.

Logo that appears when first booting ubuntu from livecd.

Hit enter, and F6 for other options, select nomodeset, hit enter to enable then Escape and enter to boot.
If operating from a laptop, you might want to try noapic too.

 

In the latest grub setup – grub 2 – the boot menu is hidden, making it near impossible to access.
Might make it look pretty but is major frustrating for troubleshooting!
The script /boot/grub/grub.cfg it uses is supposed to boot in textmode if it has failed to boot, but this does not work.

The fix:

Note: you can login, type

sudo su

and then skip typing sudo with every command below (it gets quite annoying I know!)

  1. To access the grub bootmenu, hold down shift – after all your pc’s bios and add-on cards bios screens have disappeared and until it pops up – it takes a while to appear!
  2. To access the console – textmode, insert the word text and remove ‘splash quiet’ from the kernel options,
    also insert the word nomodeset
    then press F10 or Ctrl-C to boot with the new settings.
  3. Connect to the internet, if using Wired connection you may need to connect (hopefully you connected ok during the install)

    sudo nmcli -p con up id “Wired connection 1”

    If that doesn’t work check your wireless connections names with and edit the above command appropriately

    nmcli con

  4. Install xserver-xorg-video-ati

    sudo apt-get install xserver-xorg-video-ati

    (don’t freak out when you see ‘Removing Mythubuntu-desktop’ it seems to come right in the end.

  5. Create a new link for the X server
    (Not sure why this breaks after the upgrade but it won’t work without this step!!)

    sudo ln /usr/bin/Xorg /usr/bin/X

  6. Edit the default bootmenu script
    Add nomodeset to the default grub bootmenu

    sudo nano /etc/default/grub.cfg

    Change this line near the top:

    GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”
    to
    GRUB_CMDLINE_LINUX_DEFAULT=”nomodeset”
    #”quiet splash”

    The # tells it to ignore this bit, it’s a backup so that we can make it quiet again later. You’ll notice text streaming by as the system boots instead of the cute (Myth) Ubuntu …. logo

    Ctrl-X to exit, type s and Return to save

  7. Update grub

    sudo update-grub

  8. Reboot and Revel in the shinyness

    sudo reboot

I actually ran this command to to start the windows manager, (and I haven’t tried rebooting yet, shhh)

sudo start lightdm

If you have any extra trouble, comment below, check the ubuntu forums and google.
I managed to work this out on my own as I couldn’t find the answer!

 

I also created a script to set the resolution of lightdm at boot, following the guide here:
LightDM Resolution

This did not work as when I started lightdm, the resolution was set higher than I’d set in lightdm, so I don’t think this was part of the fix.
Thankfully it was within my monitors capabilities. I think I set the output name wrong.
I need to figure out the display outputs are available but couldn’t query it from the command line without x running, which seems kinda silly.

Hope this has been helpful!

Go (wéiqí, igo, baduk, cờ vây) opening

I’ve been playing Go a bit of late, and a friend was taught this about openings, during a review of a game on KGS. Posting it here mainly so I remember for the future! 🙂

Teofrostus [2k]: when you're playing go, there's a nice checklist that you should go through during the opening 
Teofrostus [2k]: it goes something like this
Teofrostus [2k]: 1) Do I have any weak groups?
Teofrostus [2k]: 2) Does my opponent?
Teofrostus [2k]: 3) Are there any unapproached corners? [opponent corners before allied corners]
Teofrostus [2k]: 4) Are there any "big points" left?
Teofrostus [2k]: and you should respond to these in this order

Also worth noting:
Teofrostus [2k]:it's something that you should follow until you're like 3d

Prevent Adobe Acrobat Crashing Firefox

I’m using Adobe Acrobat (for compatibilities sake only, please post your favourite PDF program in the comments below!), but I’ve been rather annoyed recently at it having a tendency to hang Firefox if I tried to open more than one PDF file from the internet.

Simple fix/hack – make Firefox save PDF files rather than open them.

  1. Open Options (Tools \ Options in Windows and Edit \ Preferences in Linux)
  2. Open the Applications tab
  3. under ‘Adobe Acrobat Document’ change the value of the dropdown to ‘Save file’

Firefox Applications options tab. Vista I know!

  1. OK the change
  2. All done. Hopefully that’s one less annoying crash to worry about!

Ps get Session manager to save yourself loosing a window full of tabs or having to do a horribly manual procedure like recovering tabs from a accidentally closed Firefox window.

Help firefox wget and ssh shell script

I’m trying to create a script to allow me to command a remote server to download a file from firefox.

There are various reasons for this, mainly todo with connection speed.

What I have at the moment is:
#/bin/sh
terminator -x ssh user@site.com wget -qc -t 3 -o ~/wget_testlog ftp://anothersite.com/file.ext \\& \& &

I want it to kick off, ask for a password to login via ssh and then go away…
I would like to be able to set the location for the download to ~/www/files/

I was planning to place this script in /usr/bin and install it in firefox using the code/link provided on this blog: Wget from firefox

Can anyone complete my solution with the correct syntax, or provide a better solution (preferably KISS)?
I’m more of hacker than an expert IMO and I know when I’m out of my depth!

Cheers,
Garreth