CodeWalrus

General => General Help & Troubleshooting => Topic started by: Caleb Hansberry on November 09, 2015, 11:28:29 PM

Title: Caleb Learns Linux
Post by: Caleb Hansberry on November 09, 2015, 11:28:29 PM
So, I finally got around to installing Linux on my Netbook! It wasn't easy because I couldn't get the motivation to do it on my main laptop cause it ran Windows 7 just fine and I like Windows 7, but my netbook ran Windows 7 so poorly I finally got fed up with it. Then I tried to install Ubuntu but it was still slow, and it's layers of shiny graphics confused me because I wanted to understand what it was doing and how it worked, but then I installed ArchLinux and couldn't understand anything or even get it installed, naturally enough. XD And then my Ethernet port broke which was a problem for installing it since it had to be connected to the internet to install so I had to replace that. Finally I installed Antergos, which was recommended by some people here, and it's doing okay and I'm ready to try to understand it and try to run programs I need! I found it interesting that it gave me the choice of a lot of different desktop environments to choose; I chose KDE because it sounded familiar.

So here's what I have to do:
Change screen backlight level. The slider appears but the brightness never changes.
Connect to wifi. It was able to do that during installation, but just like Ubuntu, as soon as it's installed, it no longer can, its as if there's no wifi driver?
Use sleep mode so it can sleep when I close the lid and resume when I open, to save power. Right now it crashes every time I close the lid and reopen it - screen stays black and HDD no longer responds, and I have to restart the computer.

Learn to program *something* - my prior experience is only QBasic and TI-Basic and I need to try something new and I have decided to do it on this netbook, cause it's portable, powerful, and the battery should last several hours. Python has been recommended to me by basically everyone, so I plan to try using it - so I'll need help getting set up with that on the netbook and a suitable tutorial. My desire is to have control of 2D graphics on the screen eventually, not math or stuff like that except where needed.
And here is a list of every task I ever do on a computer. If Linux can do these you know I'm happy: IRC, Email, Google Chrome for synchronization, watching anime videos in .mp4 and .mkv, torrenting things mostly anime videos, Minecraft, Unreal Tournament (I don't have much hope for this one but I do play it a lot), communicatng with my Windows Phone and Android phones for putting anime videos on them, and composing or editing music with MuseScore or similar program, plus LMMS and Audacity. Also it'd be cool if it could speak the time like my old Powerbook cause that's awesome. :)
Title: Re: Caleb Learns Linux
Post by: novenary on November 10, 2015, 12:20:30 AM
Yay ! Getting it installed is the first step in learning.

About you choosing KDE, while it does indeed feel sort of familiar for a Windows user, it is also the most resource-hungry environment, so it's not really recommended for a netbook. The easiest way to switch is to reinstall, which you might not want to do. It's fine if you're not bothered by the performance.

If you need documentation, the ArchWiki (https://wiki.archlinux.org/) is your friend, and since Antergos is basically Arch with an easier setup, all the information applies directly. Of course the Antergos wiki (https://antergos.com/wiki) will be a good help as well.

For what you want to do: there are countless IRC clients for Linux, Hexchat is a great GUI client, if you want to look more like a hacker, WeeChat and Irssi run in a terminal and are great clients as well.
You can either check your email using the web interface your mail provider should give you, or through a client such as Thunderbird.
Chromium is available on Antergos, see here (https://wiki.archlinux.org/index.php/Chromium) for the differences with Chrome.
For videos, VLC is available on Linux, though you might find that mpv will deliver better performance despite being more bare bones (it's actually pretty featureful, but you'll have to dig through the manual and edit the config file by hand to customize it).
For torrents, I recommend either Transmission which is a pretty simple client, or Qbittorrent which is designed after uTorrent and is my personal favorite.
Minecraft runs just fine on Linux but I wouldn't expect much on a netbook, it's Minecraft after all. :P I don't know for UT.
To connect a phone, see the MTP (https://wiki.archlinux.org/index.php/MTP) page. For the most part on KDE, install kio-extras and it should work (not mentioned on that page though).
For music, LMMS and Audacity are available, I don't know MuseScore but I'm pretty sure you can find an equivalent if it's not.
For the last one, I'll leave the research fun up to you, it's possible to do it. :)
Title: Re: Caleb Learns Linux
Post by: DarkestEx on November 10, 2015, 12:25:33 AM
Great that you are using Linux now :)

While Linux is awesome I personally wouldn't ever use ArchLinux as my desktop OS as I tried switching to Arch before. It worked, yes, but even though I like the command line, it was too much configuring for me to work with it in any productive manner so I gave it up. It also messed with my UEFI which is probably the reason why I wrote the old EFI image back and abandoned that partition. I am glad still having Windows 10 installed.
Though I have Linux dual booted with Windows 10 on my Workstation and I end up using Linux (Xubutu) almost all the time there.
Title: Re: Caleb Learns Linux
Post by: novenary on November 10, 2015, 12:31:06 AM
Yeah, Arch Linux is pretty technical, you need some experience with Unix systems and the will to troubleshoot problems yourself as well as carefully reading the docs if you are going to use it. It's not hard, just very technical. I use it as my main OS because I do have this level of experience and patience with computers, and I like tinkering with things in general.
Title: Re: Caleb Learns Linux
Post by: DarkestEx on November 10, 2015, 12:49:01 AM
Quote from: Streetwalrus on November 10, 2015, 12:31:06 AM
Yeah, Arch Linux is pretty technical, you need some experience with Unix systems and the will to troubleshoot problems yourself as well as carefully reading the docs if you are going to use it. It's not hard, just very technical. I use it as my main OS because I do have this level of experience and patience with computers, and I like tinkering with things in general.
Same here, but my main problem was the UEFI, a component I never used before as all my previous computers weren't new and had an old BIOS builtin. It was my first time using an UEFI.
I do like Arch but I would prefer one that comes with everything needed preinstalled as I don't find that much time to deal with customizing my OS.
Title: Re: Caleb Learns Linux
Post by: novenary on November 10, 2015, 12:50:50 AM
Antergos is pretty much Arch with an installer, so you don't have to mess with the uefi yourself and you get a GUI all set up right from the first boot.
Title: Re: Caleb Learns Linux
Post by: DarkestEx on November 10, 2015, 01:01:57 AM
Quote from: Streetwalrus on November 10, 2015, 12:50:50 AM
Antergos is pretty much Arch with an installer, so you don't have to mess with the uefi yourself and you get a GUI all set up right from the first boot.
The problem is the horrible selection of uefi installers for Linux. They overwrite whatever they want which sucks. I had no issues installing arch itself.
About the desktop, I would have gotten this set up at some point, but it was the uefi which left me uninstalling it again.
Title: Re: Caleb Learns Linux
Post by: Yuki on November 10, 2015, 01:54:59 AM
I don't really mind installing Arch Linux by myself, it's actually a fun thing to do when you have enough time, at least for me who knows his way in the command line. It's more for those who want the most control possible over their Linux installation, without compiling everything yourself.

With that said, Linux is a great way to repurpose old computers beyond their end of life. I also have a fairly old netbook that ran Windows 7 so poorly it's almost unusable (seriously, an Atom CPU with 1GB RAM with Win7? You gotta be kidding me). So I installed Linux on it, works like a charm and it's currently sitting in my living room as a server, comparable to your average entry-level VPS.
Title: Re: Caleb Learns Linux
Post by: aetios on November 10, 2015, 12:03:03 PM
MuseScore is available for linux.
Title: Re: Caleb Learns Linux
Post by: novenary on November 10, 2015, 12:28:40 PM
Quote from: Juju on November 10, 2015, 01:54:59 AM
I don't really mind installing Arch Linux by myself, it's actually a fun thing to do when you have enough time, at least for me who knows his way in the command line. It's more for those who want the most control possible over their Linux installation, without compiling everything yourself.

With that said, Linux is a great way to repurpose old computers beyond their end of life. I also have a fairly old netbook that ran Windows 7 so poorly it's almost unusable (seriously, an Atom CPU with 1GB RAM with Win7? You gotta be kidding me). So I installed Linux on it, works like a charm and it's currently sitting in my living room as a server, comparable to your average entry-level VPS.
Yup, Linux is great for that kind of stuff. It's also the main operating system for most ARM devices, most Raspberry Pi users run Linux on it as well besides the minority that runs windows 10 IOT, RISC OS, or do bare metal stuff. I have a Raspberry Pi 2 doing the job of an entry level VPS as well, running Arch (:P), and my old model B is running a bare metal application that should be superseded soon (see my GameCube thread for details on what it's doing).
Title: Re: Caleb Learns Linux
Post by: Yuki on November 10, 2015, 02:50:49 PM
Yeah, Linux is the main OS for quite a lot of stuff except consumer-grade x86 desktops (running Windows and OS X of course) and Apple devices (such as the iPhone).
Title: Re: Caleb Learns Linux
Post by: Dream of Omnimaga on November 10, 2015, 05:26:31 PM
Why not for x86 desktops? Did most Linux  distros drop compatibility with 32-bits computers or something?
Title: Re: Caleb Learns Linux
Post by: novenary on November 10, 2015, 05:29:22 PM
No they didn't, x86 usually includes both the 32 bit and 64 bit versions. What Juju is saying is that Linux isn't really widespread on these machines, since Microsoft is still keeping its monopoly on the market (and the only machines that ship with Linux have cty distros anyway, most Linux users prefer installing their favorite distro whatever the hardware).
Title: Re: Caleb Learns Linux
Post by: Caleb Hansberry on November 11, 2015, 09:26:19 AM
Thanks for all the responses!

I'll make a full length reply when I have some time.
Title: Re: Caleb Learns Linux
Post by: Caleb Hansberry on November 15, 2015, 01:48:07 AM
Okay, so I've been working with Linux all of today, here's what I've got.

Wifi works if I enter "sudo modprobe brcmsmac". I've tried to make it run that command when it boots, but it hasn't done it yet - so for it just refuses to load the wifi unless I type that command into the terminal.

I have been able to change the brightness level if I modify the "brightness" value directly: "echo x | sudo tee /sys/class/backlight/intel_backlight/brightness", where x is a number between 0 and 13046. Nothing else has worked so far, and the use of the Fn keys I have not succeeded in connecting to the backlight, despite that I see using "acpi_listen" it's reading them fine.

At this point, I suppose after some change I made, the laptop no longer function right. x_x I reboot it, but as soon as it reaches KDE again, it freezes. I can sometimes open Kickoff, sometimes not, but whether I select Konsole in it or press Meta+C for the console, the console never opens. If I try to open console, then after it fails to open it, it just sits there silently not responding to anything clicked or typed. It also cannot open other programs.
Title: Re: Caleb Learns Linux
Post by: novenary on November 15, 2015, 09:27:37 AM
That's unfortunate, it will be hard to troubleshoot without access to the machine. Your best bet at this point is a reinstall I suppose. :/
Title: Re: Caleb Learns Linux
Post by: Travis on November 15, 2015, 04:58:48 PM
Yeah, reinstalling is probably the easiest way for now while you're still learning your way around, even if it wouldn't be strictly necessary if you knew what was wrong and how to fix it.

One good idea is to write down (or keep in a text file somewhere) everything you do on the system as root or with sudo, so if something breaks you can retrace your steps and try to figure out what you might have done to cause it. It also gives you a list of things to redo if you have to reinstall or switch to another distro so you don't have to figure it all out again. I wish I had done that on my current Arch desktop system; I plan to get back into that habit when I change to some other distro which I'm planning to do someday because rolling release doesn't seem to work well for me.



The recommended way to make modules load automatically on boot on Arch-based systems is described here: https://wiki.archlinux.org/index.php/Kernel_modules#Automatic_module_handling
Basically, you make a file in /etc/modules-load.d/ and list the modules you want. Putting "brcmsmac" on a line in one of these files ought to work. On my Arch desktop right now, I have '/etc/modules-load.d/custom.conf' which I created and just threw things in:

# Load extra needed modules that aren't loaded automatically

loop
#uvesafb
#acpi_cpufreq
vboxdrv
vboxnetflt
vboxnetadp


Lines starting with # are ignored; the rest are modules I wanted loaded on boot because they don't load automatically for whatever reason. (In case you're curious, 'loop' is the module that allows mounting and accessing things like the contents of ISO and disk image files directly as if they were actually on a disk in my system, the 'vbox...' stuff is drivers for VirtualBox (lets me run other OSes in virtual machines from inside the main OS), and the commented-out lines are apparently stuff I was once fooling around with and decided I didn't need (I might as well delete those).



Can't really answer the backlight thing since I've never really had to mess with ACPI stuff much.
Title: Re: Caleb Learns Linux
Post by: novenary on November 15, 2015, 05:02:35 PM
Why would you load loop on boot ? I thought it was supposed to be automatically loaded when you mount something with -o loop (and apparently mount is smart enough to make this option implicit).
Title: Re: Caleb Learns Linux
Post by: Travis on November 15, 2015, 07:22:28 PM
It doesn't seem to work for me. I have to always load it separately before the mount -o loop or losetup commands work.
Title: Re: Caleb Learns Linux
Post by: novenary on November 15, 2015, 08:30:40 PM
Strange, it seems to work fine over here, I don't even need to specify -o loop, and the module gets loaded.
Title: Re: Caleb Learns Linux
Post by: Lionel Debroux on November 21, 2015, 09:04:09 PM
Under Debian sid amd64, loop isn't loaded by default or automatically when I use `mount -o loop`, either.
Title: Re: Caleb Learns Linux
Post by: Caleb Hansberry on December 04, 2015, 02:15:45 AM
Aaaaah been too long since I posted my update here, I know.
So I've been messing around with Antergos. Reinstalled it with Gnome (I think, whatever the default was) as the desktop environment instead of KDE. Now the wifi works fine for some reason. The brightness is the same issue, but I succeeded in making a script that worked, I had to chmod +x it which was interesting. It takes the value of "/sys/class/backlight/intel_backlight/brightness", stores it into a variable called "luminance", adds or subtracts 1000 (the range is 0 to 13046), and stores it back.

Next I need to make some sort of exponential function to control the brightness. This will be hard. The brightness changes much more dramatically at lower numbers, so should change less, and less at high numbers. Like 6000 to 12000 is a small difference, and 20 to 1000 is a big difference (20 is the lowest you can stil lsee anything on the screen). Got any ideas as to how this would work? I never was very good at math, never really finished Algebra, and don't know where to start.

Next I need to install Python for programming. I know it has python installed, but I need a good beginner tutorial that is aimed at graphics not math, and I'll need a good IDE.
Title: Re: Caleb Learns Linux
Post by: semiprocoder on December 04, 2015, 02:37:00 AM
Well, instead of adding or subtracting to or from the brightness, I suggest multiplying/dividing the brightness by some value. It would be best if you start with 20 and then add from there.

Here are some values I calculated, which 20 as the min val and 13046 as the max val.
~3.655 with 5 different brightness values
~1.9118 with 10 different brightness values
~1.5404 with 15 different brightness values
and ~1.3827 with 20 different brightness values.

I calculated it using this, with n=num different brightness values:
(13046/20)^(1/n)=(652.3)^(1/n)
same thing(hopefully) but just in latex:
[tex](\frac{13046}{20})^{\frac{1}{n}}=652.3^{\frac{1}{n}}[/tex]

In other words, [tex]\sqrt[n]{652.3}[/tex].
Hope that makes sense, and otherwise just use my precalculated variables.
Title: Re: Caleb Learns Linux
Post by: Travis on December 04, 2015, 01:25:43 PM
Ooh, this is one of those fun, practical uses for using graphing calculators. :) You can experiment with different formulas like the ones "semiprocoder" gave in function graphing mode and play with them until you get a curve that does what you want. It can take some trial and error, but eventually you get a feel for what math operations do what to the graph. Or, if you have some idea of a few inputs you want to map to what outputs at different points, you can throw them into the statistics editor and find a regression model that might be close to what you want. (Perhaps I just happen to have a bit too much fun doing this. ;) It's definitely educational, though.)

Implementing the equations in bash scripting might be slightly tricky, though, since math is very limited, and I don't think it does floating point. You can easily pass the equations to external programs like 'bc' or even python and capture the output result and use it, though.

Graphics in Python has a bunch of choices, depending on what "system" you want to use. It has its own Tkinter GUI toolkit built in (and apparently a turtle graphics module as well), but there are also libraries for using SDL, GTK+, Qt, and other GUI toolkits with Python. There are certainly a number of IDEs available, but I don't know much about them. I haven't really felt the need to use an IDE, personally; a good text editor with good multiple-file and Python-syntax support, some open terminal windows, and an interactive shell like ipython, work pretty well for me.
Title: Re: Caleb Learns Linux
Post by: Caleb Hansberry on December 04, 2015, 10:04:11 PM
Nice, guys! 1.3827 is a nice enough number. The math part definitely confused me though to be honest. I actually tried using my CSE for the task first but it threw an error that I didn't understand :(

Can't figure out how to get it into bash though. I believe all I need to do is multiply brightness by 1.3827 and then store the result back into brightness, but first I need to figure out how to do that part, and then I need to stop it from giving the LCD panel a decimal number (was that the technical name? a number with numbers to the right of the decimal point) cause it won't like that. Then I also need to stop it from giving it a number above 13046. I tried just stripping off the numbers to the right of the decimal point, but that does weird stuff to the math when you multiply, remove them, and then divide, and remove them again.
Maybe I could store the variable that it does math on elsewhere, and only turn it back into an integer when it's stored into Brightness.

For Python, most likely Turtle is fine right now. So I can just program in Nano then?


Anyways, here's my code:
brightness=$(cat /sys/class/backlight/intel_backlight/brightness)
luminance=$(expr $brightness * 1.3827)
if $luminance > 13046 then $luminance=13046
echo $luminance | sudo tee /sys/class/backlight/intel_backlight/brightness

But it doesn't work >_> something about the "if" command used there?
Title: Re: Caleb Learns Linux
Post by: Yuki on December 04, 2015, 10:14:01 PM
You're missing a few stuff here. Here's a more correct code.

if [ $luminance -gt 13046 ]
then
luminance=13046
fi
Title: Re: Caleb Learns Linux
Post by: Caleb Hansberry on December 05, 2015, 01:15:45 AM
Ah, thanks Juju! When I tried it, it told me some error, but then Travis gave me a different code which I used and it worked well - sorry that I didn't use your's :'(

But, it finally works right! I could change the brightness with the function keys out of the box in windows, but for some reason it failed in Linux. But now it finally is put together. The finished script that Travis and the others helped me put together is:
brightness=$(cat /sys/class/backlight/intel_backlight/brightness)
luminance=$(python –c "print(min(int(round($brightness * 1.3827)),13046))")
echo $luminance | sudo tee /sys/class/backlight/intel_backlight/brightness


It changes the brightness with 20 levels beautifully, and I do understand how it works which is great :D Then I just made a file in the /etc/acpi/events/ directory containing:
event=video/brightnessup BRTUP 00000086 00000000
action=/usr/local/bin/brightnessup


To tie the ACPI event to the script, and it worked well! Next I need to tell it to run "sudo systemctl start acpid.service" when it boots up, because it doesn't work without that.

[EDIT] Okay so I added an entry to .bashrc to start the acpid service. However, that means the brightness buttons don't work until I open the terminal and type my sudo password. How else should I be doing this so I don't need to type my password to execute this command and don't need to open the terminal?
Title: Re: Caleb Learns Linux
Post by: Travis on December 05, 2015, 05:32:31 PM
Try "sudo systemctl enable acpid.service". That should set it to start acpid automatically during bootup.
Title: Re: Caleb Learns Linux
Post by: Caleb Hansberry on December 22, 2015, 11:01:50 PM
Thanks Travis, that worked fine!

Sorry I've been really busy this season, plus the netbook screen got damaged so half the screen flickers now. Turns out netbooks are really very finicky. I'll get back to it as soon as I can though.
Title: Re: Caleb Learns Linux
Post by: Caleb Hansberry on August 31, 2016, 03:45:48 AM
Alright, I think I'll be able to return! I'm pretty committed to giving Linux a fair shot even if it's loads of work :P

The netbook screen got worse and I couldn't handle it anymore, I just threw it away (on ebay for cost of shipping). So I finally got a new HDD for my desktop and wanna try dual booting Windows and Linux. Unless a different distro offers something major, I'll still plug away at Antergos, my experience wasn't bad with it.

How do I set that up? I'm installing Linux on a 160GB HDD, and have windows on 120GB SSD and a 1TB data drive. Should I modify the 160 from linux or windows to make the swap and root partitions?
Title: Re: Caleb Learns Linux
Post by: Yuki on August 31, 2016, 04:24:13 AM
The three of them are going in the same computer? Well, that would work. Just install GRUB on the first drive and it will do the job. Swap can go besides the Linux partition, or on the SSD, the partition layout is up to you, you can put the different partitions on the different drives however you want, the only important thing is Windows being installed first (else it's a pain) and Linux's bootloader (usually GRUB) in the MBR of the first drive (or EFI partition if it uses that thing). Also, your 1TB data drive should be formatted in something Windows recognizes (usually NTFS, great support nowadays in Linux) if you want to use it in both OSes, but I guess you already know that :P
Title: Re: Caleb Learns Linux
Post by: Travis on September 02, 2016, 08:20:48 PM
Most of the Linux installers have partitioning functionality built in, so you'll be able to set things up from there.

If you want to be really safe about the Windows disk and your BIOS has a convenient way to select which disk is booted from, you could install the bootloader for Linux on its own disk and leave the Windows's default bootloader in place, just in case something goes wrong. Ideally, you might be able to have the Linux disk's bootloader still give the option to boot either to the Windows disk or to Linux but still have the Windows disk original bootloader there for you to switch to if GRUB somehow breaks.

I don't personally have much experience with dual-booting Windows. I tried it on an old Vista laptop, and could never get the bootloader to work reliably at all, for reasons I never could figure out. Windows would just straight up refuse to fully boot, just rebooting in the middle of loading. Only after a lot of futzing around (sometimes without actually even changing anything) would it sometimes work once or twice, so I gave up on that. (The version of Linux Mint I tried had too many bugs on this machine, anyway.)
Title: Re: Caleb Learns Linux
Post by: Lionel Debroux on September 04, 2016, 09:24:54 AM
FWIW, I never had problems dual-booting Windows on my or work computers, since the summer of 2005.
I recently destroyed the Windows copy on this computer to gain some breathing space on the HDD, and I seldom boot Windows on the other computers, the latest one of which was preinstalled with Win 10, but still :)
Title: Re: Caleb Learns Linux
Post by: Caleb Hansberry on September 08, 2016, 01:18:45 PM
Alright, I think I've got it. I tried setting it up correctly through Linux, but I messed something up, maybe I needed to disable secure boot in the BIOS I dunno. But once Linux was installed it just booted up Windows, so I ran EasyBCD and added a BCD entry for Linux and that seems to work I think.

I'm having an issue with Linux on the first time running it. When I try to run apps, they load for a bit then stop and nothing happens, and when I try to change settings or otherwise authenticate, when I type my password and click Authenticate, it sits there doing nothing until I finally press the Cancel button. So I can't change settings, update, or run apps right now. Some apps run like the system settings but others like the music player on the desktop don't. Also I don't think I set up a swap partition (16GB RAM).
Title: Re: Caleb Learns Linux
Post by: p2 on September 08, 2016, 02:20:33 PM
the "secure boot" option in bios just blocks booting from external devices like USBs, that's all it does :)
It's ment to prevent attackers from using konBoot and other stuff (only effective if you also use a bios pasword of cause - and they dont know how to remove a battery ^^)
Title: Re: Caleb Learns Linux
Post by: Lionel Debroux on September 08, 2016, 05:57:16 PM
The number of Linux distros supporting secure boot is growing.
Title: Re: Caleb Learns Linux
Post by: Travis on September 09, 2016, 02:50:33 AM
If you know the command names of any of those programs that won't start, open a terminal within your desktop environment and try running some of them from there and see what they say.

Figuring out the name of the launch command can take some guessing/research, but many are obvious (i.e. "firefox" for Firefox, "libreoffice" for LibreOffice, etc.).
Title: Re: Caleb Learns Linux
Post by: Yuki on September 09, 2016, 03:44:50 AM
Oh, you can always look at the launcher's properties, in the menu's configuration or check the files owned by a package. If you know your way around, it is possible to easily figure out the command.
Title: Re: Caleb Learns Linux
Post by: Caleb Hansberry on September 09, 2016, 05:16:10 AM
Alright, I looked into that. If I'm not mistaken, there are dependency issues causing these programs to not start. My solution was to just install Dolphin, it automatically installed all the dependencies and now it runs as the file manager :s I guess I can fix the other apps that way too, just by installing new ones that work. Not sure if I need to uninstall anything. It doesn't help the issue with being unable to login though. I can still login with the terminal, just never with Gnome...