Mounting NTFS (windows filesystem) on Linux with ntfs-3g or ufsd
You can mount ntfs a couple of different ways in linux. Here is how you do it with ufsd or ntfs-3g. ufsd needs a kernel module installed. ntfs-3g can just be installedRead More…
You can mount ntfs a couple of different ways in linux. Here is how you do it with ufsd or ntfs-3g. ufsd needs a kernel module installed. ntfs-3g can just be installedRead More…
Wait you thought Samba and SMB and CIFs are all the same thing? Well kind of. The are all part of the same protocol that allows file sharing, and gives you theRead More…
Login to Mysql (notice username and password touch the -u and -p argument)
1 |
# mysql -uusername -ppassword |
mysql> SHOW databases;
1 2 3 4 5 6 7 8 9 |
+--------------------+ | Database | +--------------------+ | information_schema | | mysql | | observium | | performance_schema | | wpdb | <--- we want this one (its our wordpress database) +--------------------+ |
mysql> USE wpdb; NOTE: we can skip asking mysql to USE a database andRead More…
Lets see what files are missing from packages that are partially installed. Note this will not work on packages that are not at least part way installed (they need to be listedRead More…
If you have binary programs or scripts generating files in /tmp and you want to grab them before they disappear, then use this script. You can copy them. If you copy themRead More…
Final:
1 |
(PKG="linux"; dpkg -l | grep $PKG | awk '{print $2}' | xargs -I %% /bin/bash -c 'echo "---%%----"; dpkg -L "%%" | xargs -I @@ /bin/bash -c "[[ -f '@@' ]] && ls -lisah '@@'"' | nl > /tmp/${PKG}.pktxt; cat /tmp/${PKG}.pktxt; ) |
Use this same technique to find out which files are missing from packages: http://ram.kossboss.com/see-filesfolderssymlinksetc-missing-debian-package/ ————– For example all of the packages that are mono. I want to see all of theRead More…
Check for line endings with od (also you can use other hex tools with -c option – which is the Printable Characters format)
1 |
od -c file |
DOS: \r \n (carriage return and a newline) CRRead More…
The problem / error: When doing an rsync over ssh file transfer I get this error.
1 2 3 4 |
# rsync -avhP -e "ssh -p 22 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" file root@someserver.com:file Warning: Permanently added '[root@someserver.com]:22,[24.155.888.155]:2022' (ECDSA) to the list of known hosts. protocol version mismatch -- is your shell clean? (see the rsync man page for an explanation) |
Sidenote: The options -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null, so that I dont get that Host Key authenticationRead More…
(I) Scrub: going thru the raid checking parity and correcting things. There are 2 types. check or repair. *check just reads everything and doesn’t trigger any writes unless a read error isRead More…
Watching samba locks script:
1 2 3 4 5 6 7 8 9 |
smbstatus -L | head -n 2 | tail -n 1 | nl -v0; smbstatus -L | tail -n -3 | grep . | nl; # loop the command with "watch" watch "smbstatus -L | head -n 2 | tail -n 1 | nl -v0; smbstatus -L | tail -n -3 | grep . | nl;" # loop the command with "while" (useful if you dont want the screen cleared, or if you dont have "watch" command) while true; echo "----`date`-`date +%s`----"; smbstatus -L | head -n 2 | tail -n 1 | nl -v0; smbstatus -L | tail -n -3 | grep . | nl; sleep 2; done; |
smbstatus -L just lists the headers, but it has an extra empty line at the end, and 3 header lines. We extract the important header line, and weRead More…