Monthly Archives: May 2014
fontawesome – my request – fa-bomb
HORRAY for fa-bomb!!
I’v requested a icon on fontawesome and we got it!!
Fail2Ban – its working.

I just caught a rackspace host ssh’ing!
My new server bandwidth graphs



SCP on cronjob without asking/prompting password
How to copy a file with SCP and cronjob for a external location and cronjob – server -.
#!/usr/bin/expect -f # connect via scp spawn scp "/location/file.ext" "username@host:/location/file.ext" ####################### expect { -re ".*es.*o.*" { exp_send "yes\r" exp_continue } -re ".*sword.*" { exp_send "password\r" } } interact wait sleep 2s ls
Some digitalwhores.net stats!


Linux disks structure and information
This is a result on a dedicated server.
Disk structure
sudo lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
NAME FSTYPE SIZE MOUNTPOINT LABEL sda 465.8G |-sda1 ext4 190M /boot |-sda2 ext4 464.6G / `-sda3 swap 976M [SWAP]
Disk details
sudo hdparm -I /dev/sda
/dev/sda:
ATA device, with non-removable media
Model Number: TOSHIBA MQ01ABF050H
Serial Number: 14IFC0D3T
Firmware Revision: ARF02A
Transport: Serial, ATA8-AST, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6, SATA Rev 3.0
Standards:
Supported: 8 7 6 5
Likely used: 8
Configuration:
Logical max current
cylinders 16383 16383
heads 16 16
sectors/track 63 63
--
CHS current addressable sectors: 16514064
LBA user addressable sectors: 268435455
LBA48 user addressable sectors: 976773168
Logical Sector size: 512 bytes
Physical Sector size: 4096 bytes
Logical Sector-0 offset: 0 bytes
device size with M = 1024*1024: 476940 MBytes
device size with M = 1000*1000: 500107 MBytes (500 GB)
cache/buffer size = unknown
Form Factor: 2.5 inch
Nominal Media Rotation Rate: 5400
Capabilities:
LBA, IORDY(can be disabled)
Queue depth: 32
Standby timer values: spec'd by Standard, no device specific minimum
R/W multiple sector transfer: Max = 16 Current = 16
Advanced power management level: 254
DMA: sdma0 sdma1 sdma2 mdma0 mdma1 mdma2 udma0 udma1 udma2 udma3 udma4 *udma5
Cycle time: min=120ns recommended=120ns
PIO: pio0 pio1 pio2 pio3 pio4
Cycle time: no flow control=120ns IORDY flow control=120ns
Commands/features:
Enabled Supported:
* SMART feature set
Security Mode feature set
* Power Management feature set
* Write cache
* Look-ahead
* Host Protected Area feature set
* WRITE_BUFFER command
* READ_BUFFER command
* NOP cmd
* DOWNLOAD_MICROCODE
* Advanced Power Management feature set
Power-Up In Standby feature set
SET_MAX security extension
* 48-bit Address feature set
* Device Configuration Overlay feature set
* Mandatory FLUSH_CACHE
* FLUSH_CACHE_EXT
* SMART error logging
* SMART self-test
* General Purpose Logging feature set
* WRITE_{DMA|MULTIPLE}_FUA_EXT
* 64-bit World wide name
* IDLE_IMMEDIATE with UNLOAD
* WRITE_UNCORRECTABLE_EXT command
* {READ,WRITE}_DMA_EXT_GPL commands
* Segmented DOWNLOAD_MICROCODE
* Gen1 signaling speed (1.5Gb/s)
* Gen2 signaling speed (3.0Gb/s)
* Gen3 signaling speed (6.0Gb/s)
* Native Command Queueing (NCQ)
* Host-initiated interface power management
* Phy event counters
* Idle-Unload when NCQ is active
* Host automatic Partial to Slumber transitions
* Device automatic Partial to Slumber transitions
* READ_LOG_DMA_EXT equivalent to READ_LOG_EXT
DMA Setup Auto-Activate optimization
Device-initiated interface power management
* Software settings preservation
* SMART Command Transport (SCT) feature set
* SCT Write Same (AC2)
* SCT Error Recovery Control (AC3)
* SCT Features Control (AC4)
* SCT Data Tables (AC5)
Security:
Master password revision code = 65534
supported
not enabled
not locked
frozen
not expired: security count
supported: enhanced erase
114min for SECURITY ERASE UNIT. 114min for ENHANCED SECURITY ERASE UNIT.
Logical Unit WWN Device Identifier: 5000039543a063f1
NAA : 5
IEEE OUI : 000039
Unique ID : 543a063f1
Checksum: correct
Read more at http://askubuntu.com/questions/182446/how-do-i-view-all-available-hdds-partitions http://www.cyberciti.biz/faq/find-hard-disk-hardware-specs-on-linux/
WhatsMyDNS.net
This looks good!
whatsmydns.net is an online service that allows you to instantly perform a DNS lookup to check a hostnames current IP Address and other DNS information against a selection of random name servers around the world. This is especially useful to check the current state of DNS propagation after making changes to your domains zones.
https://www.whatsmydns.net/#A/www.digitalwhores.net
SFTP – Restrain/Lock/Jail the user to their home
Create the user and their home
cd /home
mkdir username
useradd -d /home/username -M -N -g users username
sudo chown root:root /home/username
sudo chmod 755 /home/username
Edit /etc/ssh/sshd_config
nano /etc/ssh/sshd_config
Search for “lib/openssh/sftp-server” and make it like
#Subsystem sftp /usr/lib/openssh/sftp-server
Subsystem sftp internal-sftp
Add the following lines bellow it…
Match User username
ChrootDirectory /home/username
ForceCommand internal-sftp
Restart SSH
service ssh restart
More readings
http://www.techrepublic.com/blog/linux-and-open-source/chroot-users-with-openssh-an-easier-way-to-confine-users-to-their-home-directories/
http://superuser.com/questions/370953/how-to-not-allow-user-outside-of-home-directory-with-sftp
Avoid WordPress for asking FTP username and password on Plugin Updates
We must setup the right user and group owner of the files and folders.
On Ubuntu its www-data, so let chown it.
chown -R www-data:www-data /path/to/wordpress/