Skip to content

Instantly share code, notes, and snippets.

@clintval
Last active February 8, 2018 03:13
Show Gist options
  • Save clintval/a5df5024d5f117a99d96c092986b0811 to your computer and use it in GitHub Desktop.
Save clintval/a5df5024d5f117a99d96c092986b0811 to your computer and use it in GitHub Desktop.
The UNIX commands I forget

Git

Squash three commit branch and update remote branch.

$ git checkout feature_branch
$ git rebase -i HEAD~3
# Choose `pick` for the base.
# Choose `squash` for all others
$ git push -f

Filesystems

List all attached storage devices:

$ sudo blkid

Add/Remove partitions

$ fdisk /dev/sda

Make a filesystem!

$ mkfs -t ext4 /dev/sda

Samba

Default .conf location: /etc/samba/smb.conf

To view current configuration settings
$ testparm

Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Loaded services file OK.
Server role: ROLE_STANDALONE

...
See network Samba shares
$ smbtree

WORKGROUP
      \\etc....
Samba requires each user to have a smbpasswd
sudo smbpasswd -a <user>
Security

security = user indicates all those that connect must be users on the server.

security = share still requires authentication deprecated

Functional similarity to security = share:

security = user
map to guest = Bad User
Samba as a system service
$ systemctl enable --now smbd.socket

# After editing /etc/samba/smb.conf
$ systectl restart smbd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment