Wednesday 13 February 2019

Where does Skype save my contact's avatars in Linux?


I'm using Skype on Linux.


Where can I find images cached by skype of my contact's avatars?



Answer



I wanted to get those Skype avatars too so I used whitequark's answer to make a little bash script which does just that. Here it is:



#!/bin/bash

if [ \( $# -lt 1 \) ];
then
echo "Usage: $0 folder";
echo "Where folder is of the form /home/username/.Skype/username";
exit;
fi;

for i in `ls $1`;
do
if [ -f $1/$i ];
then
#echo "i: $i";
filedump=`hexdump -v -e '"" 1/1 "%02x" ""' $1/$i | sed -e 's/ffd8ffe0/\nffd8ffe0/g'`;
nocc=`echo "$filedump" | wc -l`; # occurences of the \n char. Means that there are nocc-1 occurences of our word
#echo "nocc: $nocc";
if [ "$nocc" -ge 2 ];
then
k=0;
old_IFS=$IFS; #field separator
IFS=$'\n';
offset=0;
for j in $filedump;
do
w=`echo $j | wc -m`; # gives actually lettercount+1
w=$[w-1];
offset=$[offset+w];
#echo "offset: $offset";
filename1="${i}_${k}_notclean.jpg";
filename2="${i}_${k}.jpg";
dd ibs=1 if=$1/$i of=$filename1 skip=`echo "$offset/2" | bc` status=noxfer;
if [ `du $filename1 | cut -f1` -gt 0 ];
then
convert $filename1 $filename2; #convert is actually only used to remove the data after the image
fi;
rm $filename1;
k=$[k+1];
done;
IFS=$old_IFS;
fi;
fi;
done

ntfs - Any way to recover a file with bad blocks (CRC error in Windows)?


What I see is this:



  • Windows complains when reading a file because the CRC for it mis-matches its calculated CRC.

  • This means NTFS has a CRC for the file.

  • I expect the offending block/sector can be known, or at least guessed.

  • I also expect that "wrong data" can be read from the disk.

  • If the bits of "wrong data" were inverted one by one, by brute force we could find the correct data.

  • A file could thus be recovered using statistics and brute-forcing bits to match the CRC.


My question is, does any software do this kind of thing? Any way I could do it (I'd be happy enough to get the CRC, the drive's "wrong" data, know which is the offending block/sector there, and write a script to brute it myself, if relevant directions are given).


By the way, this is a mechanical HDD.


Edit: After taking a look with hex editors and such, I noticed that a bad block appears as garbage, such as filled with zeros or a copy of the last block (this seems to depend on the program), so in order to get the "real data" that is corrupted, we'd have to disable some hardware-correction that refuses to read a block which is bad. I believe this is called ECC. Also, I expect that if just a few bits are marking a block as "bad", then some 32-bit checksum from Windows could be used to brute force a match.


So this question may be answered simply with guidance to do this by myself.



Answer



Unfortunately, what I wanted to do is not possible (NTFS does not store a CRC, the hard drive does).


However, I recommend SpinRite, as it is in the process of recovering a hard drive (with a painfully slow speed of some GBs per day, occasionaly I mount the filesystem to see how's the state of the files).


It may or may not work for you, so if the data is worth a few thousand dollars, go to a specialized hard drive recovery place. It's terribly costly but sometimes experts get data out of unlikely situations.


Oh, and one last recommendation: if the data is worth a few thousands, DON'T touch the drive. Don't mount it anymore, don't dare to boot from it, don't run chkdsk, don't do ANYTHING. It might compromise the drive's chance to being recovered.
But if it's a drive with songs, movies, or other non-important content, don't miss the chance to play with it to your heart's content! :)


What exactly is a Linux filesystem?

I am having trouble understanding exactly what a Linux filesystem is.


I understand it is the "directory" of files and folders located on the system: like /bin, /sbin, /etc, /opt, and so on. However, I also hear things like:



"I just need to install the filesystem on this disk."



Is that simply referring to the structure of folders in Linux? How does that tie in with ext2, ext3, ext4 types of filesystems and how are they installed exactly?

How to Move Offline Files Cache in Windows 7?


On Vista systems, I've been using these instructions to relocate the "Offline Files Cache" from its default location of c:\csc. Works great.


However, these instructions do not work on Windows 7. There is small discussion about the issue going on on TechNet but nobody yet has a solution.


The problem is that the Migration Wizard has changed in Windows 7 and no longer provides a mechanism for doing this.



Answer



I've found the following to work well. I would advise to create a restore point prior to doing the following.



  1. Create a folder for your offline file cache. Something like D:\Offline.

  2. From an elevated command prompt type the following: Takeown /r /f C:\Windows\CSC.

  3. Open the Sync Center and go to Manage Offline Files.

  4. Click Disable Offline Files and restart the machine.


  5. From an elevated command prompt issue the following commands:


    rd /s C:\Windows\CSC
    mklink /J C:\Windows\CSC "D:\Offline"

    (or whatever your folder name is, but be sure to use the quotes if you have space(s) in the name).




  6. Reopen the Manage Offline Files window and Enable Offline Files.



  7. Restart the machine.


All files/folders that are made available offline should now be redirected to whichever folder you specified.


windows 7 - Where does Firefox keep cookies?


Where does Firefox store my cookies on a windows 7 home machine? I have looked in AppData but don't see any cookie or cache folder.



Answer



Firefox generally stores cookies here:


C:\Users\User name\AppData\Local\Mozilla\Firefox\Profiles\some random list of characters.default


An easier way to open this:
WIN+R (key combination), and then:
%APPDATA%\Mozilla\Profiles\Firefox\Profiles\randomstring.default\


(You can select the folders one by one in the run dialog. Just start typing the address.)


networking - Windows 7 drive (P:|)shared with Everyone but not accessible by Windows XP computers on our network


I'm trying to share my P:\ drive on a Windows 7 (Pro) PC with other PCs (WinXP) on my network. I shared it and set permissions to give Everyone Full Control.


Symptoms




  • Computer XP(different computer on the network) can access \win7\users\ public (and copy files to it and edit files in that folder) but not the \win7\p:\




  • Folders I've shared on the Windows 7 PC are visible to the XP computers but just not accessible . From the other WinXP PCs on the LAN accessing the Win7 PC, I get "win7\p not accessible. You might not have permission to use the network resource. " "Access Denied".




Edit: I've to Advanced Sharing options set to have the following enabled:



  • Network Discovery

  • File and Printer sharing

  • Sharing so anyone can read/write files to public folders.

  • 128 bit encryption (perhaps this is an issue? Perhaps it should be set to 40 bit encryption?)

  • Allow Windows to manage homegroup.

  • XP machines are set to not use Simple File Sharing.


Other Things I've Tried



  • Confirmed all computers are in the MSHOME workgroup.

  • Turned off the Windows 7 Firewall, briefly. Problem persisted.

  • Tried the Windows 7 Network Troubleshooter. Just led me around in a circle saying "found problem...need more information". The links from there led back to the Network Troubleshooter.

  • tried disabling the Firewall on the Windows XP machine. No joy.

  • Verified the XP machines are both on Win XP SP3 and both have "download updates" turned on.

  • Installed IE8 on the XP machine1. (Previously it had IE 6). Still no joy.


Any ideas?



Answer



Try this on the Windows 7 machine:



  1. Open Administrative Tools -> Local Security Policy.

  2. Click on Local Policies -> User Rights Assignment on the left.

  3. Double-click "Deny access to this computer from network".

  4. Select Guest and click Remove.

  5. click OK.

  6. EDIT: Ensure in the Permissions for the network share, that Guest is included, since it's no longer part of the Everyone group.

  7. Use regedit to go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System and create or modify the value of LocalAccountTokenFilterPolicy (32-bit dword) to 1, so the remote logon token will not be filtered (see here).


linux - How to read ls -l permissions


I've been trying to understand Linux permissions. I know that I could download one file via CyberDuck from a remote Linux machine and the other one I was not able to. Here is the output of ls -l:


-rw-r--r-- 1 root root 5360 Jul 26 17:31 coworking1.crt
-rw------- 1 root root 1704 Jul 26 17:31 coworking1.key

(image of output of ls -l)


Please tell me:



  1. How can I read the line -rw-r--r-- 1 root root?

  2. Besides permissions duplication via chmod --reference:file1 file2, how could I set the permissions of coworking1.key to be the same as coworking1.crt via a bash command?



Answer



In the line -rw-r--r-- 1 root root, the first dash character indicates a file without any special permissions on it. The next 3 characters "rw-" indicate that the owner of the file can read and write to the file, but the file is not executable. I.e., it isn't a program that you could run. If it was also executable, you would see "rwx" rather than "rw-".


The next 3 characters, "r--" indicate that any other accounts in the group for this file, which is "root", only have read access; since there are dashes where the "w" and "x" could appear, that indicates those permissions aren't granted to the file for the group. The following "r--" indicates that "others", i.e., accounts that aren't the owner and which aren't in the group that has access to this file have only read access. When you see "root root", The first "root" is the account that owns the file. The second "root" shows the group that applies to the file. The group doesn't necessarily have to be the same as the owner; they could be different. E.g., there could be a group named "test" that has root and the account jdoe in it. But in this case, the root account is likely the only account in the root group. You can see the groups on the system by issuing the command cat /etc/group You could set the permissions for coworking1.key to be the same as coworking1.crt with chmod 644 coworking1.key or chmod g+r,o+r coworking1.key. In the latter example you are adding read access for the group and read access for others.


For references, see Understanding Linux File Permissions and Linux Tutorial - 8. Permissions, which will explain why chmod 644 coworking1.key also works. But, basically you can think of the 3 positions in each grouping having a numeric value of 4 for the first position, 2 for the second position and 1 for the third position. So, if the permission is "rw-", you would have a total of 6. If it is "r--" you have a value of 4. If it was "rwx", you would have a total of 7. Those numbers apply to each grouping. So using 644 means that you have 6 for the owner (rw-), 4 for the group (r--) and 4 for all other accounts on the system (r--). But you can always use the chmod g+r,o+r coworking1.key format and not worry about how to set permissions numerically. For that format, using a plus sign adds the permission and using a minus sign removes the permission.


Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...