Skip to content

Linux etc. tips #27

@seyyah

Description

@seyyah

MC

$ mc
Error opening terminal: xterm-256color.

$ TERM=xterm mc

Kaynak: https://unix.stackexchange.com/questions/385834/error-opening-terminal-xterm-256color

WATCH

$ watch -n1 -c "ps -ax | grep raspivid"

WGET

$ wget --limit-rate=200k --no-clobber --convert-links --random-wait
  -r -p -E -e robots=off -U mozilla http://www.kossboss.com

Coding

gem install serve
serve 9000

VEYA

python3 -m http.server 80

Kaynak: https://askubuntu.com/questions/377389/how-to-easily-start-a-webserver-in-any-folder

Network

DNS

dig seyyah.me +nostats +nocomments +nocmd

IP

Locale IP from browser (ör. Porteus için)

Port

  • Built-in
netstat -atnp
nc -zv 176.101.133.23 8443
  • How to scan local network for SSH-able computers?
nmap -sS -p 22 192.168.1.0/24
  • Makinede sshd çalışıyor mu? Port açık mı?
$ sudo netstat -plant | grep :22
tcp  0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1467/sshd       
tcp  0 0 192.168.1.58:22 192.168.1.58:57242 ESTABLISHED 1487/sshd: pi [priv
tcp6 0 0 :::22 :::* LISTEN 1467/sshd 

-Easily see what's happening on your computer's ports https://github.com/caarlos0/ports

$ ports ls
$ port show 4000
$ port kill 4000

Genel

$ inxi -SNxz
$ ifconfig -a
$ sudo uname -a -r

DDRESCUE

ddrescue -D --force debian-8.8.0-amd64-i386-netinst.iso /dev/mmcblk0

DMESG

$ dmesg -wH # ~ tail -f 

MBR Sil

After burning the kiosk on usb stick the Windows operating system shows only XX MB as available size. How can i recover my usb key?
Kiosk uses hybrid ISO images which installs isolinux bootloader to the Master Boot Record of the drive. Its enough to delete MBR content and partition table to make the drive fully usable again. Windows users should follow this guide. Linux users can use 'dd' command to wipe the MBR of the usb stick:

dd if=/dev/zero of=/dev/sdX bs=1M count=10

kill

Kill the process,

$ pkill -15 -f process

Change defaul editor

$ sudo update-alternatives --config editor

$ sudo select-editor # in mc

Curl image/etc. download,

$ curl -o app/assets/images/rails.png -OL railstutorial.org/rails.png

Sublime

Multiple line editing,
image

Clock

ntpdate pool.ntp.org
hwclock --systohc --localtime

hwclock
date

Kaynak: https://docs.slackware.com/howtos:hardware:syncing_hardware_clock_and_system_local_time

FIND

Dosya ve boyutları,

find . -type f -name "*.ext" -exec ls -lh {} \;

Recursive + file list > csv,

find . -printf "%04k kB;;%p\n" > t.csv

Driver

How to list all loadable kernel modules?

find /lib/modules/$(uname -r) -type f -name \*.ko

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions