accidentally moved and fixed /bin/ directory, but now can't su


I accidentally moved my /bin directory to /usr/bin/bin, anyway, I managed to move it back to its place with

# /usr/bin/bin/mkdir /bin
# /usr/bin/bin/mv /usr/bin/bin /

and then I was able to login as root, but I wasn’t able to su from my user, it gave me an authentication error. I ran chmod +s /bin/su and chmod u+s /bin/su as root, and it fixed it.

another thing I noticed is that I can’t ping either; it gives me this error:

$ ping 192.168.1.1
ping: icmp open socket: Operation not permitted

and this is my ping file:

-rwxr-xr-x 1 root root 44K Jun 30 20:38 /bin/ping

I guess I messed up all the permissions and SGID on my /bin folder. Is there any way to fix this? (other than formatting)

Just for the record, I’m using a 64 bit Debian 8.

Update kernel to 4.1.1 in Ubuntu Mini


I’m using Ubuntu Mini 15.04 and I want to update the kernel to the latest 4.1.1. I’ve been looking online but there are so many different ways. I’ve tried some but always ran into some error.

I am not using a GUI, just command line.

Mouse freeze after logging in to Gnome


I did my first Arch Linux install yesterday. I later installed Gnome and I’m able to log in.

The touchpad and mouse buttons work at the log in screen but once I’m logged on the Touchpad does not work.

I’m on an older Acer Aspire notebook.

How to write a script that can take input from stdout


I want to be able to write a script that can take stdout as an argument, if anything is piped into it (ultimately, I would like it to be polymorphic) -

The trouble is, I have searched and searched for how to do this with no avail – lots of alternative suggestions about how to do other things that are not – this:

cat /var/log/some.log | grep something | awk '{print $1 $6 $8}' | myscript

Why do that, instead of? : myscript $(!!)
At this point, solely to prove that it is possible…

I know that you can ‘read variable’ in a script, but say I don’t care about the lines – let’s say, I want to accept the whole of it as a blob of text and do something with it in the script –

Do I really have to :

while read x; do
stdin=$stdin" "$x;
done;

solely in order to read from STDIN ?

There must be a better way …

indirection requires pointer operand and expected expression errors


I keep getting errors similar to these:

pitstop.cpp:36:23: error: indirection requires pointer operand

        ('double' invalid)

         cost = UNLEADED * gallons;

                          ^ ~~~~~~~

pitstop.cpp:40:14: error: expected expression

                    cost = SUPER * gallons;                               ^

#include <iostream>
#include <iomanip>
using namespace std;

#define UNLEADED 3.45;
#define SUPER {UNLEADED + 0.10};
#define PREMIUM {SUPER + 0.10};

/* 
    Author: Zach Stow
    Date: 
    Homework 
    Objective:
*/

double cost, gallons;
string gasType, finish, stop;

int main()
{
    for(;;)

    {

        cout <<"Hi, welcome to Pitstop.n"; 
        cout <<"Enter the type of gas you need:";
        cin >> gasType; 
        cout << endl;

        cout <<"Enter the amount of gallons you need:";
        cin >> gallons;
        cout << endl;

        if(gasType == "finish" || gasType == "stop")break;

        else if(gasType == "UNLEADED")
        {
            cost = UNLEADED * gallons;
        }
        else if(gasType == "SUPER")
        {
            cost = SUPER * gallons;
        }   
        else if(gasType == "PREMIUM")
        {
            cost = PREMIUM * gallons;
        }

    }   
    cout <<"You need to pay:$" << cost << endl;

    return(0);

}

I changed my mid on distributions for power pc g5 where is fedora? [on hold]


I need/want fedora for powermac g5 but couldn’t find it some assistance would be nice, thank you in advance.

How to move a PC's Debian to a USB and remain fully bootable?


I have a 64 GB USB 3.0 drive, to which I’d like to transfer (in terms of file system and grub2 bootability) the Debian Jessie installed on the SSD of my retina MacBook Pro.

I am looking to do this in as few steps as possible, and for the result to be a seamless working bootable USB that boots up the exact same Debian install with my Icedove mail folders, customised settings, Nautilus tweaks, etc.

What is the most convenient way to do this?

Lastly, I have cryptsetup installed as it’s a LUKS-encrypted LVM, not sure how that would complicate things. Other than that, no propietary drivers, everything as free and simple as possible. amd64.

Printer drivers


I hope this is an appropriate question. (If not, I’ll be happy to delete it.)

I run Linux exclusively (home and business). I have standardized on HP printers because the HP driver works well. I don’t have to worry about any driver issues.

However, now I am thinking about purchasing a different brand printer for the first time in years. I would like to know which printer manufacturer(s) have put in the effort to have solid Linux support.

In case it is relevant, here is the printer I’m considering: Brother Printer MFC-L8850CDW Wireless Color Laser Printer with Scanner, Copier and Fax

Explaining SMART power error


I use gsmartcontrol, on the Error tab, it shows:

Complete error log:

SMART Error Log Version: 1
ATA Error Count: 398 (device log contains only the most recent five errors)
    CR = Command Register [HEX]
    FR = Features Register [HEX]
    SC = Sector Count Register [HEX]
    SN = Sector Number Register [HEX]
    CL = Cylinder Low Register [HEX]
    CH = Cylinder High Register [HEX]
    DH = Device/Head Register [HEX]
    DC = Device Command Register [HEX]
    ER = Error register [HEX]
    ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.

Error 398 occurred at disk power-on lifetime: 125 hours (5 days + 5 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  84 51 01 0f 08 00 00  Error: ICRC, ABRT at LBA = 0x0000080f = 2063

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  60 10 00 00 08 00 40 00      00:09:15.084  READ FPDMA QUEUED
  ec 00 00 00 00 00 00 00      00:09:15.006  IDENTIFY DEVICE
  ef 10 03 00 00 00 00 00      00:09:14.990  SET FEATURES [Enable SATA feature]
  ef 10 02 00 00 00 00 00      00:09:14.974  SET FEATURES [Enable SATA feature]
  b1 c1 00 00 00 00 00 00      00:09:14.959  DEVICE CONFIGURATION FREEZE LOCK [OBS-ACS-3]

Error 397 occurred at disk power-on lifetime: 125 hours (5 days + 5 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  84 51 01 0f 08 00 00  Error: ICRC, ABRT at LBA = 0x0000080f = 2063

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  60 10 00 00 08 00 40 00      00:09:14.756  READ FPDMA QUEUED
  ec 00 00 00 00 00 00 00      00:09:14.678  IDENTIFY DEVICE
  ef 10 03 00 00 00 00 00      00:09:14.662  SET FEATURES [Enable SATA feature]
  ef 10 02 00 00 00 00 00      00:09:14.646  SET FEATURES [Enable SATA feature]
  b1 c1 00 00 00 00 00 00      00:09:14.631  DEVICE CONFIGURATION FREEZE LOCK [OBS-ACS-3]

Error 396 occurred at disk power-on lifetime: 125 hours (5 days + 5 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  84 51 01 0f 08 00 00  Error: ICRC, ABRT at LBA = 0x0000080f = 2063

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  60 10 00 00 08 00 40 00      00:09:14.508  READ FPDMA QUEUED
  60 01 00 02 00 00 40 00      00:09:14.506  READ FPDMA QUEUED
  60 04 00 07 00 00 40 00      00:09:14.506  READ FPDMA QUEUED
  60 01 00 00 00 00 40 00      00:09:14.506  READ FPDMA QUEUED
  60 01 00 00 00 00 40 00      00:09:14.506  READ FPDMA QUEUED

Error 395 occurred at disk power-on lifetime: 125 hours (5 days + 5 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  84 51 01 0f 88 b9 0a  Error: ICRC, ABRT at LBA = 0x0ab9880f = 179931151

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  60 10 00 00 88 b9 40 00      00:00:15.234  READ FPDMA QUEUED
  ec 00 00 00 00 00 00 00      00:00:15.156  IDENTIFY DEVICE
  ef 10 03 00 00 00 00 00      00:00:15.141  SET FEATURES [Enable SATA feature]
  ef 10 02 00 00 00 00 00      00:00:15.125  SET FEATURES [Enable SATA feature]
  b1 c1 00 00 00 00 00 00      00:00:15.109  DEVICE CONFIGURATION FREEZE LOCK [OBS-ACS-3]

Error 394 occurred at disk power-on lifetime: 125 hours (5 days + 5 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  84 51 01 57 d1 54 08  Error: ICRC, ABRT at LBA = 0x0854d157 = 139776343

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  60 08 00 50 d1 54 40 00      00:00:14.984  READ FPDMA QUEUED
  ec 00 00 00 00 00 00 00      00:00:14.922  IDENTIFY DEVICE
  ef 10 03 00 00 00 00 00      00:00:14.906  SET FEATURES [Enable SATA feature]
  ef 10 02 00 00 00 00 00      00:00:14.891  SET FEATURES [Enable SATA feature]
  b1 c1 00 00 00 00 00 00      00:00:14.875  DEVICE CONFIGURATION FREEZE LOCK [OBS-ACS-3]

smart attributes

what does this mean? and how to prevent that errors?

Downloading a file using Services Views


I’ve created an API using the Services Module (by way of the Services Views Module) that I am accessing via a Single Page Application. In this application, users need to be able to download a selection of files.

This selection of files has been setup in a view that make available to the app using the Services Views Module. When I access the api in my app, I can get all off my data fine but I run into an issue when I try and download movies and pdf’s.

Is there a special formatter I need in order to make files downloadable via my api?

Question and Answer is proudly powered by WordPress.
Theme "The Fundamentals of Graphic Design" by Arjuna
Icons by FamFamFam