Showing posts with label when. Show all posts
Showing posts with label when. Show all posts

Saturday, December 17, 2016

Mount non Linux drives automatically when they are not in etc fstab

Mount non Linux drives automatically when they are not in etc fstab


So, I usually face this problem when Im not using GUI based File Managers. They allow you to auto mount drives when you click on them but when you are using CLI based file managers or no file managers at all, the only way is to mount them through writing commands. Im a lazy fad and I want this done automatically. So heres a script for that. [ https://gist.github.com/Tafhim/5d0839caca813ae82c97 ].

#!/usr/bin/zsh
if [[ "$1" == "" ]] then
echo "Please specify a device name";
exit;
fi;
deviceFile=$1

## Auto mount only ntfs, fat32, vfat
for i in $(ls $deviceFile* | grep [0-9]$); do
blkid -s UUID -o value $i | read z;
blkid -s TYPE -o value $i | read f;
echo "$z is $f";
if [[ "$z" != "" && ("$f" == "ntfs" || "$f" == "vfat" || "$f" == "fat32" ) ]] then
/usr/bin/udisksctl mount -t $f -b $i # https://help.ubuntu.com/community/AutomaticallyMountPartitions
fi;
done


Go to link download

Read more »

Monday, November 21, 2016

Stop the laptop from going stand by when lid is closed in Xubuntu

Stop the laptop from going stand by when lid is closed in Xubuntu


I hate the fact that I have to figure this out for every new distro I use. But here it goes for Xubuntu. Tested and working in 14.04 LTS.

1. Open the file /etc/systemd/logind.conf
2. Find the line "HandleLidSwitch="
3. Set it like "HandleLidSwitch=ignore" and if it has a "#" (hash" in front of it, remove it.
Save and reboot and you are good. :)
Credits: http://askubuntu.com/a/362692/145915

Go to link download

Read more »

Saturday, November 19, 2016

When chsh simple does not work

When chsh simple does not work


I got into this problem lately in a Live environment of the new Ubuntu MATE release where no matter how many times I change the password using sudo passwd it simply does not effect chsh. So, when I type in

chsh -s /usr/bin/zsh
It asks for the password. And when I type the password in, it does not work. It simply says "PAM: Authentication Failure". Ok, so go for Googling. Later, I found out that all user home and shell infos are stored in a file located by /etc/passwd. Now you need root to do this. So how do you get root? For a Live system, thats simple. just type in

sudo -i
It should give you the # prompt so youre root now. Now just open the file using your favorite editor like

nano /etc/passwd
Then find your user name and change the string right after the last : on that line. Done. Reboot and go. For now, I seriously dont know why chsh didnt work. :( anybody have any clues?

Go to link download

Read more »

Wednesday, October 19, 2016

Linux Mint 13 Lisa Fix screen going blank when Laptop lid is closed

Linux Mint 13 Lisa Fix screen going blank when Laptop lid is closed


In my workplace they have Linux Mint 13 setup for the machines. I personally hate it and my employer too, so we will be shifting to some other Distro very soon, but in the mean time I had to make do with it. We have an extra display attached to every laptop. One of the things that bugs me the most is the "Power management" doesnt have any "Do nothing" option. And if you somehow (yes, theres a way) make it appear, it does the exact same thing as "Blank screen", so yeah, "Aw snap!!". It didnt take much of googling to find Mint forum page that solved the problem though [ http://forum.linuxmint.com/viewtopic.php?t=106532&f=208 ]
Basically the problem is caused by a faulty assumption in design. It always executes and Screen Blank instruction set, when you close the laptop lid. What you have to do is just comment out one line in the event handler script.
1. First open the file, you might need root rights to edit this, so use sudo if you need
/etc/acpi/lid.sh
2. The find the line
. /usr/share/acpi-support/screenblank
3. Comment that line out with
#
It should be fixed immediately.

Go to link download

Read more »

Friday, September 16, 2016

Vivo X3 will become the worlds thinnest smartphone when officially launched

Vivo X3 will become the worlds thinnest smartphone when officially launched


Vivo X3 will become the world's thinnest smartphone when officially launched
Vivo X3 will become the world's thinnest smartphone when officially launched
Chinese phone manufacturer is preparing to launch BBK vivo X3 thinnest smartphone in the world. In an effort to promote before the launch date, BBK has taken the idea of ??turning the phone 5.6 mm
Read more »

Go to link download

Read more »

Wednesday, September 14, 2016

When you cant log into Postgresql from Web Interface Adminer etc

When you cant log into Postgresql from Web Interface Adminer etc


I ran into this problem earlier this week and left it until today, when I needed it work at all cost. Turns out it was a simple issue with the configuration file. Heres the process.

First of all, open the file /etc/postgresql/9.1/main/pg_hba.conf
Find the line : "local" is for Unix domain socket connections only
Below that line there is a line like this: local all all md5
Just change the last value to: peer
So the line now looks like: local all all peer
Now save the file (you need to be root)
Then restart the Postgresql process using the command: sudo service postgresql restart
Done.

Go to link download

Read more »

Monday, August 29, 2016

Windows When your machine does not let you write to any USB device

Windows When your machine does not let you write to any USB device


Check this out. Worked for me [ http://superuser.com/questions/459507/usb-drive-becomes-write-protected-after-inserting-it ]

Go to link download

Read more »

Friday, August 12, 2016

Iphone 4 no LCD No Image NO booting when LCD Connected

Iphone 4 no LCD No Image NO booting when LCD Connected


phone 4 no LCD, No Image. NO booting when LCD Connected

Customer was complaining, his iphone 4 wouldnt start. When powered the phone without the touchscreen, it would boot and Itunes would make his thing. But my PSU showed the usage of maximum Ampere (limited at 1,2A) when powering on with an connected LCD indicating a problem with the LCD powering rails.

measured LCD_5V7_AVDDH with 1,2V insted of 5,7V

Multimeter showing a partial short to ground. So i started removing those caps one by one until the short disappeared. After the third cap with sucess. After replacing the bad ones, the phone was working again

Go to link download

Read more »