from thk thk on 2017-05-31 13:30 1 comments
1 1 votes
wait..Voting.. bad good
Poulao
potaPoulao pota
from thk thk on 2017-04-03 15:24
1 1 votes
wait..Voting.. bad good
Η γατα θελει ηλιοΗ γατα θελει ηλιο
from thk thk on 2017-03-18 00:43
wait..Voting.. bad good
Για user iconΓια user icon
from thk thk on 2017-03-12 00:56
1 1 votes
wait..Voting.. bad good
windows shit machine

Got this laptop from a friend to install linux and windows.
Laptop is  new and has  a pentium quad core N4200, 4gb ram , 256 kingston ssd .
Came preinstalled with linpus linux lite that never booted , showing an error message about disks.
It took about 3-4 days and many hours ,  to finally install both OSes, make grub come first before windows boot manager, and finally solving the shutdown problem in linux .

To install Linux Kubuntu 16.10 and Windows 10 on Acer Aspire ES1-533-P9FW :

1. Bios


Press F2 to go into BIOS when the computer starts.
Set a supervisor password at security tab .You have to do this in order to disable secure boot.
After this at the Boot tab select Secure Boot and set to Disabled
At main tab enable F12 Boot Menu
Save And exit



2. OS INSTALL

The computer does not provide legacy bios and boot only in UEFI mode despite having linux preinstalled.

I have tried both ways ,  installing windows first and linux after ,  or as someone suggested Linux first and then windows 10.

I don't think that matters but on the latest successful install I installed Kubuntu 16.10 first.
When you install Windows 10 , a new option appears in the Boot Order in Bios called Windows Boot Manager.
Unfortunately when you install Linux the same does not happen.
Download Windows 10 and Kubuntu 16.10,  and burn the isos on usb , on windows,  with rufus   , choosing partition scheme GPT for UEFI.

Go into bios and in boot order bring up USB devices.
Reboot.

2.1 Linux install

If kubuntu 16.10 does not boot
reboot and press F12 to bring up boot menu,
, select  Linux (    ) from the menu and press enter.
Start Kubuntu in testing mode.
On the Kubuntu live session:

---Partitioning --
Run KDE partition manager from the live session and partition the drive ,
Recreate partition table , and
make an efi partition around 200 mb first,
then make ext4 partition for Linux ( I assigned 40 gb after the first Efi) ,
Swap partition (assigned 3gb) ,
data ntfs partition for windows and linux to share (assigned about 130gb),
and finally ntfs partition for windows 10 (assigned 60 gb) .
Press apply to wait partitioning to complete.
Close KDE partition manager.

Install Linux following this guide
Open a Konsole window and run

sudo ubiquity -b

so the setup does not install grub , and you will install grub later as described below.

1) Boot Ubuntu Live DVD/USB in testing mode and open terminal

2) Run installation process without installing bootloader by:

sudo ubiquity -b

3) Press Continue testing after installation is over.

4) Mount newly installed file system into /mnt:

sudo mount /dev/sda2 /mnt sudo mkdir /mnt/boot/efi sudo mount /dev/sda1 /mnt/boot/efi for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; done 

(where sda2 is the root partition and sda1 is the efi partition)

5) Load efivars by:

sudo modprobe efivars 

6) Reinstall grub-install for a 64bit version

sudo apt-get install --reinstall grub-efi-amd64
sudo grub-install --no-nvram --root-directory=/mnt

7) Change root to /mnt and update grub

sudo chroot /mnt sudo update-grub 

8) Move and rename the installed bootloader

cd /boot/efi/EFI 
sudo cp -R ubuntu BOOT
cd BOOT
sudo cp grubx64.efi bootx64.efi

9) Reboot the system.

At this point grub is alone and should boot only linux without problem.


2.2  Install windows

Insert windows 10 usb , reboot , and install Windows 10 , at the partition you created before.

This goes with no problem .

After that turn off fast startup in windows , or do it with regedit :

Change:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Power

HiberbootEnabled DWORD

0 = Turn off fast startup
1 = Turn on fast startup

Now on win 10 login screen at the bottom right corner where you  can shutdown , you will have 3 options instead of only 2 shutdown, restart that were shown before   .  Shutdown, Restart and sleep (as you understand before this shutdown meant sleep (!)) . Windows 10 boots fast because it tries to never shut down, and hibernate when you  choose to  shutdown . Another nice innovation from our friends at Microsoft.

Also I have to inform you that Windows 10 now features more and more  explanatory messages like : "Windows is getting ready" when it performs the windows update we all love.

After win 10 installation,  windows boot manager takes over and you can boot linux only by pressing F12  during boot which brings up the laptop  boot menu. If you reinstall grub or reinstall linux , grub will not take over. After win 10 installation "Wndows Boot Manager" appears as an option in boot order in bios. If you set it second after the hard disk, it will not solve the problem. ES1-533 sees linux if you press F12 boot menu key during boot , but I could not see it inside bios boot order. In linux you normally change the efi boot order with the efibootmgr -o command, but this command totally crashes and freezes the pc. I am very sure that this command is responsible for freezing the laptop during ubuntu installation , so I reported a bug .

So the only way to bring grub first was to use bcdedit from Windows 10 . Let's fool Windows:

From powershell opened as admin ,  run :

bcdedit /set '{bootmgr}' path \EFI\BOOT\bootx64.efi .

You may can't change the order of boot managers with bcdedit but you can change the .efi file path of windows boot manager so that it will point to the one we created while setting up linux  in step 1.

Reboot .

After this grub should come first , but it will not have windows boot option.

Start linux and do a

sudo update-grub

and it should see it.

Ensure the Hard Disk is before Windows boot manager in boot order in Bios .

If you press F12 during boot you should see 2 windows boot manager entries and one  linux .



3. Linux is not shutting down

The newest fashion in linux is that pc's are not shutting down.

You press  shutdown button in your desktop , pc reaches a state where it prints "Reached target shutdown" or "Reboot: power down" and it stucks there without powering off.

Saw that bug on 16.04 installation on an old Dell laptop with core duo, and the problem  was resolved by...   installing the wireless drivers..

I also saw that this bug has been posted as systemd bug and I came to a point where I believed I could not find a solution , at least for the time being as this pc is very new.

I tried to update the bios from windows and i did updating it to 0.8 from 0.4.

Procedure is very easy and I suggest you do it.

You go into acer website put the snid of your laptop and you download the bios update and run it from windows 10.

Then read an archlinux forum where someone suggested to take a look at kernel messages with dmesg.

Run dmesg and if you see a message:

Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug

edit /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="pci=nocrs"

and

sudo update-grub

This solved the problem

Now the pc is expected to shut down from linux instead of stucking in Reboot: Power off.

Last one is a world first from kaotonik.net and linux master thk.



VIVA LINUX - resist to  microsoft and UEFI !!






from thk thk on 2016-11-14 15:18
1 1 votes
wait..Voting.. bad good
If you have a folder that contains thousands of files (in my case it was the motion daemon folder that contained thousands of pictures and videos from a surveillance camera) this script will organize them in sub folders named by the last modification date.

import os 
import sys
import time
from datetime import datetime
import shutil

def orgbyday(directory):
    ans=raw_input("Going to organize files in directory : " + directory  +  " by  modification day in subfolders.Type 'y' to continue:")
    if ans != 'y':
print 'exiting'
sys.exit(0)
    print "listing dir: " + directory
    l = [file for file in os.listdir(directory) 
         if os.path.isfile(os.path.join(directory, file)) ] 
   
    ilen = len(l)
    slen = (str(ilen))
    print "found " + slen + " files"
    i=1
    startt= time.time()
    for f in l:
 
percent = (float(i) / float(ilen)) * 100.0
spercent = "%.2f" % percent
   
print str(i) + " of " + slen 
print spercent + " %  "
passed=time.time()-startt
remaining = (ilen  - i) * (passed / i)  
m, s = divmod(remaining, 60)
h, m = divmod(m, 60)
print "%d:%02d:%02d" % (h, m, s)
#print str(remaining)
print f
ff=os.path.join(directory,f)
mtime = os.path.getmtime(ff)
print "modified: %s" % time.ctime(mtime) 
mdate = datetime.fromtimestamp(mtime)
creation_day = mdate.strftime('%Y-%m-%d')
subfolder = os.path.join(directory,creation_day )
dest = os.path.join(subfolder , f )
try:
   shutil.move (ff , dest)
except:
   os.mkdir(subfolder)  
   shutil.move (ff , dest)
print "                               "
print " "
print "\x1b[2J\x1b[H"
i +=1
 
if __name__ == '__main__':
    orgbyday(sys.argv[1])


from thk thk on 2016-11-12 20:36
wait..Voting.. bad good
ChaniaChania
from thk thk on 2016-11-09 01:29
2 2 votes
wait..Voting.. bad good
Mf!Mf!
from thk thk on 2016-11-07 19:39
2 2 votes
wait..Voting.. bad good
Δε χωριζει θαλασσα απο ουρανοΔε χωριζει θαλασσα απο ουρανο
from thk thk on 2016-11-07 00:32
wait..Voting.. bad good

Και απηλθον
Και απηλθον