samba ... mount windows shares from windows

mount windows shares on windows
net use \\192.168.1.2\share password /USER:sambauser







lm-sensors debian

lm-sensors on debian
Monitor-Read Hardware Sensors; temperature, voltage, fan speed

# apt-get install lm-sensors
# sensors-detect
# sensors


example output of sensors
# sensors
k10temp-pci-00c3
Adapter: PCI adapter
temp1:        +57.4°C  (high = +70.0°C)
                       (crit = +105.0°C, hyst = +104.0°C)






lm-sensors debian



iw voyage linux

Messing with iw the nl80211 based CLI configuration utility on Voyage Linux

# iw --version
iw version 3.4


Show wifi interface(s) capabilities
# iw list
or
# iw phy


Disable a wifi interface
# ip link set wlan0 down


Bring up a wifi interface
# ip a |grep wlan
5: wlan0:  mtu 1500 qdisc mq state DOWN qlen 1000
# ip link set wlan0 up
# ip a |grep wlan
5: wlan0:  mtu 1500 qdisc mq state DOWN qlen 1000


Scan for cells-WLANs in range
# iwlist wlan0 scan


Create the mon0 monitor interface
# iw phy phy0 interface add mon0 type monitor


Bring up the mon0 monitior interface
# ip link set mon0 up


Delete the mon0 monitor interface
# iw dev mon0 del


List network interfaces, map them to the wireless hardware
# iw dev
phy#0
    Interface wlan0
        ifindex 5
        type managed


# iw phy phy0 interface add mon0 type monitor
# iw dev
phy#0
    Interface mon0
        ifindex 7
        type monitor
    Interface wlan0
        ifindex 5
        type managed


Put a wifi interface in managed mode
# iwconfig |grep wlan
wlan0     IEEE 802.11abgn  Mode:Master  Tx-Power=30 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
# iw dev wlan0 del
# iw phy phy0 interface add wlan0 type managed
# iw dev
phy#0
    Interface wlan0
        ifindex 7
        type managed


Use wpa_supplicant
# apt-get install wpasupplicant


# wpa_supplicant -i wlan0 -c <(wpa_passphrase somessid passwd)
or put in background
# wpa_supplicant -B -i wlan0 -c <(wpa_passphrase somessid passwd)
in case there is a DHCP server in the WLAN
# dhclient wlan0


use wpa_supplicant to connect to a specific bssid
# cat /etc/wpa_supplicant/wpa_supplicant-scripts/test.conf
#test.conf
#connect to chosen bssid and broadcasted ssid
ap_scan=1
network={
    bssid=6c:99:ed:40:43:e8
    ssid="somessid"
    #psk="somepasswd"
    psk=c715c20684b1a80454f7b67acd8613b865b8870493be1a4b104539ec90fbc02f
}
# wpa_supplicant -i wlan0 -B -c /etc/wpa_supplicant/wpa_supplicant-scripts/test.conf


See the set regulatory domain
# iw reg get
country GR:
    (2402 - 2482 @ 40), (N/A, 20)
    (5170 - 5250 @ 80), (N/A, 20)
    (5250 - 5330 @ 80), (N/A, 20), DFS
    (5490 - 5710 @ 80), (N/A, 27), DFS
    (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR


Set regulatory domain
# iw reg set US
# iw reg get
country 98:
    (2402 - 2472 @ 40), (N/A, 20)
    (5170 - 5250 @ 80), (N/A, 17)
    (5250 - 5330 @ 80), (N/A, 20), DFS
    (57240 - 63720 @ 2160), (N/A, 40), NO-OUTDOOR

if you see country 98, your regulatory domain is the intersection of the regulatory domain in EEPROM and the one set in user_space

Listen to events, eg see a managed interface while assosiating with an AP with wpa_supplicant
# wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant-scripts/test.conf


# iw event
wlan0 (phy #0): scan started
wlan0 (phy #0): scan finished: 2412 2417 2422 2427 2432 2437 2442 2447 2452 2457 2462 5180 5200 5220 5240 5260 5280 5300 5320, ""
wlan0: new station 6c:99:ed:41:43:e8
wlan0 (phy #0): auth 6c:99:ed:40:43:e8 -> 05:f0:21:1e:5b:08 status: 0: Successful
wlan0 (phy #0): assoc 6c:98:eb:40:43:e8 -> 05:f0:21:1e:5b:08 status: 0: Successful
wlan0 (phy #0): connected to 6c:99:ed:40:43:e8
phy #0: regulatory domain change: set to GR by a country IE request on phy0
wlan0: del station 6c:99:ed:40:43:e8
wlan0 (phy #0): deauth 05:f0:21:1e:5b:08 -> 6c:99:ed:40:43:e8 reason 3: Deauthenticated because sending station is leaving (or has left) the IBSS or ESS
wlan0 (phy #0): disconnected (local request)
phy #0: regulatory domain change: set to world roaming by the wireless core upon initialization request
regulatory domain change: set to GR by a user request




Listen to events --see auth/assoc/deauth/disassoc frames
# iw event -f
with timing information (epoch.123456)
# iw event -t


Set regulatory domain to world_roaming? 0x00
# iw reg get
country GR:
    (2402 - 2482 @ 40), (N/A, 20)
    (5170 - 5250 @ 80), (N/A, 20)
    (5250 - 5330 @ 80), (N/A, 20), DFS
    (5490 - 5710 @ 80), (N/A, 27), DFS
    (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
# iw reg set 00
# iw reg get
country 00:
    (2402 - 2472 @ 40), (N/A, 20)
    (2457 - 2482 @ 40), (N/A, 20), PASSIVE-SCAN, NO-IBSS
    (2474 - 2494 @ 20), (N/A, 20), NO-OFDM, PASSIVE-SCAN, NO-IBSS
    (5170 - 5250 @ 160), (N/A, 20), PASSIVE-SCAN, NO-IBSS
    (5250 - 5330 @ 160), (N/A, 20), DFS, PASSIVE-SCAN, NO-IBSS
    (5490 - 5730 @ 160), (N/A, 20), DFS, PASSIVE-SCAN, NO-IBSS
    (5735 - 5835 @ 80), (N/A, 20), PASSIVE-SCAN, NO-IBSS
    (57240 - 63720 @ 2160), (N/A, 0)


Show link status
# iw dev wlan0 link




iw linux voyage



simple git backup server

Simple git Backup Server Notes

Server

Install git on the server
# apt-get install git-core


Create a 'bare' repository on the storage server
$ cd ~
$ mkdir test
$ git init --bare test
Bare are repositories without a working directory, suitable for storage.

Workstation

Generate public and private key pair and copy the public key to the server
$ ssh-keygen -t rsa
$ ssh-copy-id user@server


Create a local repository and push it to the storage server
$ mkdir test
$ cd test
$ echo hi > test.txt
$ git init
$ git add test.txt
$ git commit -m 'first-commit-message'
$ git remote add origin ssh://user@server:/home/user/test
$ git push origin master








Simple git backup Server



bif

bif is a basic iptables firewall setter script



Installation
# git clone https://github.com/ipduh/bif.git
# cd bif/ && chmod 755 install.sh && ./install.sh


Configuration
Edit /etc/bif
Most likely, you will have to adjust WHITE_LIST, BAD_IP_URL and OPEN_INBOUND_TCP

Initialization
# /etc/bif














bif