Mac Os X 10.10 Yosemite disable usb ports - usb

I am struggling to disable USB ports on macs with the new Yosemite
My original intention was to give read only access to USB drives but it seems impossible, so I decided to go for the complete removal of the USB access
I followed the instructions on the osX manual but won't work
I tried this, posted here in the forum: link but it won't work
What I get now is this error link
(kernel) Can't remove kext com.apple.iokit.IOUSBMassStorageClass; services failed to terminate - 0xdc008018.
Failed to unload com.apple.iokit.IOUSBMassStorageClass - (libkern/kext) kext is in use or retained (cannot unload).
It may be because I removed the file from the extensions folder first, but if that was the case, why usb is still working?
Hope you can help somehow.
Cheers

Unload it first with
kextunload /System/Library/Extensions/IOUSBMassStorageClass.kext/
However having said that removing and even deleting this kext in Yosemite doesn't seem to prevent USB working again on reboot. In fact you now lose the ability to unload the kernel extension once loaded.

I'd like to improve the previous answer but I cannot comment on it, so I will add it here.
I am having the same problem and to solve it I confirm that you should unload the driver with
kextunload /System/Library/Extensions/IOUSBMassStorageClass.kext/
In order to keep this setting at reboot, I added a call to the root crontab (since this won't be modified by updates nor other users)
to become root
sudo su -
modify root crontab
crontab -e
add the line to the file and close it
#reboot kextunload /System/Library/Extensions/IOUSBMassStorageClass.kext/
I hope this helps

You need to unload the AppleUSBCardReader and AppleUSBODD drivers as they load IOUSBMassStorageClass. Run the following commands in the terminal:
sudo kextunload -b com.apple.driver.AppleUSBCardReader <br>
sudo kextunload -b com.apple.driver.AppleUSBODD <br>
sudo kextunload -b com.apple.iokit.IOUSBMassStorageClass

Related

Booting raw-disk windows 10 vm in virtualbox boots to grub shell

I have a dual-boot setup with Windows 10 and Kubuntu 18. Following instructions found from here and there I managed to get the Windows to run as guest in Kubuntu host as a VM using VirtualBox.
sudo usermod -a -G disk $USER
VBoxManage internalcommands createrawvmdk -filename "/path/to/vm/win10.vmdk" -rawdisk /dev/sda -partitions 1,3,4 -relative
The first line is to avoid running VirtualBox as superuser.
When I boot the VM, I briefly see an error message
Boot Failed. EFI DVD/CDROM
SystemBootOrder not found. Initializing defaults.
Creating boot entry "Boot0003" with label "ubuntu" for file "\EFI\ubuntu\shimx64.efi"
and then end up in grub shell. Now, when I run the commands
insmod chain
set root=(hd0,gpt1)
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
boot
Windows boots and works just fine but entering these every time is not exactly smooth workflow. Any idea how to permanently fix this?
Please note that I'd still like to be able to physically boot into both OS's.
Thanks,
I had the same problem. I fixed it, but then updated my kernel and so grub re-un-fixed it for me! Figuring it out for the second time was quicker, but I figured it'd be even quicker next time to find my answer on StackOverflow!
My grub.cfg file in /boot/efi/EFI/ubuntu looked like this:
search.fs_uuid 47d6233f-c0ae-4f89-bf18-184452eac803 root hd0,gpt6
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg
Because we have setup the VirtualBox vmdk file with only the selected partitions for Windows to work, the search.fs_uuid command was failing, $root was empty and so grub can't find $prefix/grub.cfg (/boot/grub/grub.cfg in my linux rootfs which is on sda6==gpt6)
I automated it by changing the EFI grub.cfg, note my EFI System partition is 2 not 1 as in your example:
search.fs_uuid 47d6233f-c0ae-4f89-bf18-184452eac803 root hd0,gpt6
set prefix=($root)'/boot/grub'
if [ -f $prefix/grub.cfg ]
then
configfile $prefix/grub.cfg
else
insmod chain
set root=(hd0,gpt2)
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
boot
fi
Now if grub can find the cfg file it will give me the menu to select the boot as before, but if it can't - when I'm in VirtualBox - it'll just boot straight into Win10.
Hope this helps!

How do you make Chromium command line switches on a Chromebook?

I recently saw that ChromeOS added the functionality to do split screen windows in tablet mode in the most recent dev releases. So I put my Chromebook R11 in dev mode for the first time and updated to version 62.
The flag is one of the many on this list https://peter.sh/experiments/chromium-command-line-switches/
The only resources for actually executing these switches was http://www.chromium.org/for-testers/command-line-flags
So I tried following the steps. I went to the crosh shell with Ctrl-Alt-T. Then I typed "shell". Then "sudo su". Then I tried to modify with "sudo vim /etc/chrome_dev.conf", but it was readonly so it didn't save.
So I visited here www dot chromium dot org/chromium-os/poking-around-your-chrome-os-device and followed the steps to making changes to the filesystem and disabling rootfs verification. But the command it told me to enter just gave me an error: "make_dev_ssd.sh: ERROR: IMAGE /dev/mmcblk0 IS NOT MODIFIED."
I'm running out of ideas and resources here..
make_dev_ssd.sh is how you disable rootfs verification and modify files in the rootfs. If that's not working, that might be a bug in that script that should be reported & fixed upstream (e.g. https://crbug.com/new).
That said, are you sure you need to pass a command line flag ? Look at chrome://flags and see if the feature you want to access is available there. Many command line flag is also available on that page.
Try this:
sudo su
cp /etc/chrome_dev.conf /usr/local/
mount --bind /usr/local/chrome_dev.conf /etc/chrome_dev.conf
echo "--arc-availability=officially-supported " >> /etc/chrome_dev.conf

Vagrant stuck in "Waiting for VM to Boot"

I want to preface this question by mentioning that I have indeed looked over most if not all vagrant "Waiting for VM to Boot" troubleshooting threads:
Things I've tried include:
vagrant failed to connect VM
https://superuser.com/questions/342473/vagrant-ssh-fails-with-virtualbox
https://github.com/mitchellh/vagrant/issues/410
http://vagrant.wikia.com/wiki/Usage
http://scotch.io/tutorials/get-vagrant-up-and-running-in-no-time
And more.
Here's how I setup my Vagrant:
Note: We are using Vagrant 1.2.2 since we do not at the moment have time to change configs to newer versions. I am also using VirtualBox 4.2.26.
My office has an /official/ folder which includes things such as Vagrantfile inside. Inside my Vagrantfile are these custom settings:
config.vm.box = "my_box"
config.ssh.private_key_path = "~/.ssh/github_rsa"
config.ssh.forward_agent = true
config.ssh.forward_x11 = true
config.ssh.max_tries = 300
config.vm.provision :shell, :inline => "/etc/init.d/networking restart"
I installed our custom box (called package.box) via vagrant box add my_box absolute_path/package.box which went without a hitch.
Running vagrant up, I would look at the "preview" of the VirtualBox, and it would simply be stuck at the login page. My Terminal would also only say: Waiting for VM to boot. This can take a few minutes. As far as I know, this is an SSH issue. Or my private key issues, though in my Vagrantfile I explicitly pointed to my private key location.
Interesting Notes:
Running dhclient within the VirtualBox GUI, it says command no found. Running sudo dhclient eth0 was one of the suggested fixes.
This fix: https://superuser.com/a/343775/298915 of "modify the /etc/rc.local file to include the line sh /etc/init.d/networking restart just before exit 0." did nothing to fix the issue.
Conclusion:
Having tried to re-install everything thinking I messed up a file, it did not seem to ameliorate the issue. I am unable to work with this issue. Could someone give me some insight?
So after around twelve hours of dejected troubleshooting, I was able to (finally) get the VM to boot.
Setup your private/public keys using the link provided. My box is a Debian Linux 3.2.0-4-amd64, so instead of /root/.ssh/id_rsa.pub, you have to use /home/vagrant/.ssh/id_rsa.pub (and the respective id_rsa path for the private key).
Note: make sure your files have the right permissions. Check using ls -l path, and change using chmod. Your machine may not have /home/vagrant/.ssh/authorized_keys, so generate that file with touch /home/vagrant/.ssh/authorized_keys.
Boot your VM using the VirtualBox GUI using (through either Vagrantfile boot-GUI command, or starting your VM using VirtualBox). Login using vagrant and vagrant when prompted.
Within the GUI, manually start dhclient using sudo dhclient eth0 -v. Why is it off by default? I have no idea. I found out that it was off when I tried to wget the private/public keys in the tutorial above, but was unable to.
Go to your local machine's command line and reload vagrant using vagrant reload. It should boot, and no longer hang at "Waiting for VM to Boot."
This worked for me. Though it may be different for other machines, for whatever reason Vagrant likes to break.
Suggestion: can this be saved as a script so we don't need to manually do this everytime?
EDIT: Update to the latest version of Vagrant, and you will never see this issue again. About time, huh?

#1 - Can't create/write to file '/var/folders/

I get the following error(see. figure) in my Xampp and can not access mySQL through XAMPP and phpMyAdmin. In this link-1 and link-2 possible solution is given; but none of them woks in Mac OS 10.9
I assume the problem is with configuration file my.cnf which is located in the /Applications/XAMPP/xamppfiles/etc/my.cnf.
Any suggestion will be appreciate. Thanks.
Completely stop XAMPP, this means stop apache, ftp and mysql.
Open the program called Terminal.
Type in sudo -i to become root (or do su root if the first doesn’t work for you).
You are most probably asked for a password which you have to enter while no characters are displayed.
Execute chmod 600 /Applications/XAMPP/xamppfiles/etc/my.cnf .
Exit your root shell with exit or just close Terminal.
Restart XAMPP (apache, ftp and mysql).
From: http://slopjong.de/2009/08/31/houston-i-cant-write-to-file/
Solution
Reinstall Xampp. Before reinstalling delete all the files, take away your htdoc and database folder to other place of your hdd.
The database location in Mac OS-10.9 is
cd '/Applications/XAMPP/xamppfiles/var/mysql/'
Htdoc location
cd '/Applications/XAMPP/xamppfiles/htdocs/'
When you complete reinstallation put all the folders to corresponding location and your database will be automatically update.
I looked some other solution but none of them seems work. I was scare if I remove the database to other location and import later will it work or not. And luckily it works, but as precaution careful when you remove big database.

Trying to make a Webkit Kiosk on Debian with Raspberry Pi

I'm trying to build a Webkit Kiosk on a Raspberry Pi.
I found a good start at: https://github.com/pschultz/kiosk-browser
The things I want to do:
1) Start the kiosk without logging in (with inittab?)
Peter Schultz pointed out adding the following line:
1:2345:respawn:/usr/bin/startx -e /usr/bin/browser http://10.0.0.5/zfs/monitor tty1 /dev/tty1 2>&1
But he did not explain the steps to make this work (for noobs).
What I did is add his code to a personal git repository and cloned this repo to /usr/bin/kiosk and sudo apt-get install libwebkit-dev and sudo make.
The line to add to inittab will be:
1:2345:respawn:/usr/bin/startx -e /usr/bin/kiosk/browser http://my-kiosk-domain.com tty1 /dev/tty1 2>&1
If I do this, I generate a loop or some kind...
If you want to automatically load a browser full screen in kiosk mode every time you turn on the rpi you can add one of these two lines to the file /etc/xdg/lxsession/LXDE/autostart
#chromium --kiosk --incognito www.google.it
#midori -i 120 -e Fullscreen -a www.google.it -p
The first is for chromium and the latter is for midori, the rpi default lightweight browser.
Hint : Since we will use the rpi as a kiosk we want to prevent the screen from going black and disable the screensaver. Edit the autostart file:
sudo pico /etc/xdg/lxsession/LXDE/autostart
find the following line and comment it using a # (it should be located at the bottom)
##xscreensaver -no-splash
and append the following lines
#xset s off
#xset -dpms
#xset s noblank
Save, reboot.
More info on
http://pikiosk.tumblr.com/post/38721623944/setup-raspberry-ssh-overclock-sta
The upvoted answer suggest to run LXDE for it. You could also do it without such a heaver desktop enviorment. You could just start midori or chromium in an X session:
xinit /usr/bin/midori -e Fullscreen -a http://www.examples.com/
xinit chromium --kiosk http://www.examples.com/
Sometimes Fullscreen mode of midori is not working as expected and midori is not using whole screen. In these cases you could map it inside a very simple window manager like MatchBox to get real fullscreen. Due to xinit you have to wrap everything in a shell script.
#!/bin/sh
matchbox-window-manager &
midori -e Fullscreen -a http://dev.mobilitylab.org/TransitScreen/screen/index/11
Autostart could be done simply be using /etc/rc.local.
More information concerning screensaver issues and an automated restart could be found here: https://github.com/MobilityLab/TransitScreen/wiki/Raspberry-Pi#running-without-a-desktop
Chromium has a dependency problem on some debian derivate for arm architecture. For Cubian you find the bug report here. I am not sure if you could install chromium on latest Raspbian without problem.
But I really could recommend midori. It's very fast and support for modern web technologies is very good. As Chromium it is using webkit as rendering engine. If you miss some html5 / css3 features consider an update of libwebkitgtk (for example by using package of debian testing).
It's possible you haven't set the DISPLAY environment variable.
Try:
export DISPLAY=:0
/usr/bin/startx /usr/bin/browser
Or, browser can also take a display argument (so you don't need the environment variable):
/usr/bin/startx /usr/bin/browser :0
This works for me on Raspbian from a standard terminal shell (I'm logged in over SSH).
Updated for the current version of Raspbian (with Pixel desktop) install with noop 2.0.
I found you need to edit in two different places to get it to work.
/etc/xdg/lxsession/LXDE/autostart
/home/pi/.config/lxsession/LXDE-pi/autostart
So my configure file is:
# #xscreensaver -no-splash
#xset s off
#xset -dpms
#xset s noblank
#chromium-browser --kiosk --incognito http://localhost
And that's it.
You should probably start with checking if /usr/bin/kiosk/browser is working at all. You should start normal X session (graphical environment) on your RaspberryPi, launch terminal, try running this command:
/usr/bin/kiosk/browser http://my-kiosk-domain.com
and see what it prints on the terminal. Is this working? Do you see any error messages?
I'm trying to build a Webkit Kiosk on a Raspberry Pi.
I think Instant WebKiosk for Raspberry Pi could be useful for you.
See: http://www.binaryemotions.com/raspberry-digital-signage/