Tuesday, 1 November 2016

Virtualbox headless

Virtualbox headless

1. To start Virtualbox headless

To start vboxweb from non-root user you must:

1.1. Create or add a user in the group vboxusers (for example, user)

sudo usermod -a -G vboxusers user
The -G switch takes a (comma-separated) list of supplementary groups to assign the user to. The -a (append) switch is important, otherwise the user will be removed from any groups not in the list.
The user will need to logout and log back in to see their new group added.

1.2. Create your custom vboxweb_mod.service file by copying /lib/systemd/system/vboxweb.service to /etc/systemd/system/vboxweb_mod.service

sudo cp /lib/systemd/system/vboxweb.service /etc/systemd/system/vboxweb_mod.service

1.3. Modify /etc/systemd/system/vboxweb_mod.service to this:

[Unit] Description=VirtualBox Web Service
After=network.target

[Service] Type=forking
PIDFile=/run/vboxweb/vboxweb.pid
ExecStart=/usr/bin/vboxwebsrv --pidfile /run/vboxweb/vboxweb.pid --host=0.0.0.0 --background

User=user
Group=vboxusers

[Install] WantedBy=multi-user.target

1.4. Create tmpfile rule for your vboxweb_mod.service

sudo echo “d /run/vboxweb 0755 vbox vboxusers” > /etc/tmpfiles.d/vboxweb_mod.conf

1.5. Manually create the /run/vboxweb directory for first start vboxweb_mod.service

sudo mkdir /run/vboxweb
sudo chown user:vboxusers /run/vboxweb
sudo chmod 755 /run/vboxweb

1.6. Start/enable with:

sudo systemctl enable vboxweb_mod.service
The service will now run on startup.

1.7. To disable the service:

sudo systemctl disable vboxweb_mod.service

Monday, 31 October 2016

cisco how to save config

how to save config

Forum links


http://www.cisco.com/c/en/us/support/docs/long-reach-ethernet-lre-digital-subscriber-line-xdsl/asymmetric-digital-subscriber-line-adsl/71108-adslguide-pppoa-dynmcstep.html

Clear Existing Configurations on the Cisco DSL Router

Complete these steps:
  1. Type enable at the router prompt to enter privileged mode.
    Router>enable
    Router#
    
    !--- The # symbol indicates that you are in privileged mode.
  2. Clear existing configurations on the router.
    Router#write erase
  3. Reload the router so it boots with a blank startup configuration.
    Router#reload
    System configuration has been modified. Save? [yes/no]:no
    Proceed with reload? [confirm]yes
    
    !--- Reloading the router can take a few minutes.



  4. After the router has reloaded, enter enable mode again.
    Router>enable

    Use a Terminal Emulation Program to Backup and Restore a Configuration

    A terminal emualation program can be used to back up and restore a configuration.This is a description of the procedure using Microsoft Hyperterminal Terminal Emulation software:
    1. If the configuration needs to be copied from another router, connect to that router through the console or Telnet.
    2. At the Router> prompt, issue the enable command, and provide the required password when prompted.
      The prompt changes to Router#, which indicates that the router is now in privileged mode.
    3. Issue the terminal length 0 command in order to force the router to return the entire response at once, rather than one screen at a time.
      This allows you to capture the configuration without extraneous --more-- prompts generated when the router responds one screen at a time.
    4. On the HyperTerminal menu, choose Transfer > Capture Text.
      The Capture Text window appears.
    5. Name this file "config.txt."
    6. Click Start in order to dismiss the Capture Text window and begin the capture.
    7. Issue the show running-config command, and allow time for the router to complete its response. You will see:
      Building configuration...
      followed by the configuration.
    8. On the HyperTerminal menu, choose Transfer > Capture Text > Stop in order to end the screen capture.
    9. Open the config.txt file you created in any text editor, such as Notepad or Wordpad.
    10. Search for and remove any line that starts with "AAA".
      Note: This step is to remove any security commands that could lock you out of the router.
    11. Save the file.
    12. Connect to the router that needs the configuration.
    13. Open the config.txt file.
    14. Highlight the entire contents of the config.txt file.
      You can do this by dragging the cursor from before the first character to after the last character in the file while holding down the left mouse button. Alternatively, if you use Notepad, you can choose Edit > Select All from the menu.
    15. Copy the selected text to the Windows clipboard.
      You can either choose Edit > Copy from the text editor menu, or hold down theCTRL key and simultaneously press the C key in order to perform the copy.
    16. Switch to the HyperTerminal window, and issue the configure terminal command at the Router# prompt. Then press Enter.
    17. Paste the configuration file into the router by selecting Edit > Paste to Host on the HyperTerminal menu.
    18. After the configuration has finished pasting and the router brings you back to the configuration prompt, issue the copy running-config startup-config command in order to write the configuration into memory.
    19. Issue the exit command in order to return to the Router# prompt.

     For PPPoA
    =========

    interface ATM0
    no ip address
    atm ilmi-keepalive
    pvc 0/16 ilmi
    !
    pvc 8/35
    encapsulation aa15mux ppp dialer
    dialer pool-member 1
    !

    For PPPoE
    =========

    interface ATM0
    no ip address
    atm ilmi-keepalive
    pvc 0/16 ilmi
    !
    pvc 8/35
    protocol pppoe
    pppoe-client dial-pool-number 1
    !

Tesco settings
VPI = 0

VCI = 38

ADSL Modulation Auto, then try G.DMT, then try ANSI T1.413

Encapsulation Mode PPP over ATM (PPPoA - RFC2364) VC-MUX

Service name Home 500

Authentication CHAP 

MTU = 1458

Receive Window (RWIN)

The formula for finding your "ideal" RWIN, is to take your latency (average ping time in ms x 1.5), multiply that by your advertised (download) speed, and divide that by 8. 

Note: If setting RWIN below 8192, try using even multiples of MSS.'


Testing

example config

no service pad 
                service timestamps debug uptime
                service timestamps log uptime
                service password-encryption
                !
                hostname router
                !
                logging buffered 4096 debugging
                !
                !
                ip name-server <Name Server 1> <Name Server 2>
                !
                !
                !
                ip subnet-zero
                ip dhcp excluded-address 192.168.1.1 192.168.1.100
                ip dhcp excluded-address 192.168.1.254
                !
                ip dhcp pool dhcppool
                  import all
                  network 192.168.1.0 255.255.255.0
                  default-router 192.168.1.254
                  dns-server <Name Server 1> <Name Server 2>
                !
                !
                clock timezone NZST 12
                clock summer-time NZDT recurring 1 Sun Oct 2:00 3 Sun Mar 3:00
                !
                !
                !
                interface Ethernet0
                  ip address 192.168.1.254 255.255.255.0
                  ip nat inside
                !
                interface ATM0
                  no ip address
                  no atm ilmi-keepalive
                  dsl operating-mode auto
                !
                interface ATM0.1 point-to-point
                  pvc 0/100
                    encapsulation aal5mux ppp dialer
                    dialer pool-member 1
                  !
                !
                interface Dialer0
                  bandwidth 640
                  ip address negotiated
                  no ip redirects
                  no ip unreachables
                  ip nat outside
                  encapsulation ppp
                  dialer pool 1
                  dialer-group 1
                  ppp pap sent-username <username> password <password>
                  ppp ipcp dns request
                  no cdp enable
                !
                ip nat
                inside source list 1 interface Dialer0 overload
                ip classless
                ip route 0.0.0.0 0.0.0.0 Dialer0
                no ip http server
                !
                banner motd |Orignal config (c)IFM Ltd sales@ifm.net.nz, prepared by IFM Ltd/sales@ifm.net.nz|
                !
                line vty 0 4
                  access-list 1 in
                exit
                !
                access-list 1 permit 192.168.1.0 0.0.0.255
                dialer-list 1 protocol ip permit


Some things you might consider:
-global commands-
no snmp-server
no ip identd
no ip bootp server
no ip source-route
no ip gratuitous-arps
no ip directed-broadcast
no ip domain-lookup
no ip http server
no ip http secure-server
no cdp run
service tcp-keepalives-in
service tcp-keepalives-out
service sequence-numbers
login on-failure log
login on-success log
login block-for 60 attempts 3 within 30
-use ssh only to connect to router, if possible force version 2 and put access list to restrict vty access
ip ssh version 2
line vty 0 4
transport input ssh
- on interfaces use the following -
no ip redirects
no ip unreachables
no ip proxy-arp
no ip directed-broadcast
no cdp enable
ntp disable
- to disable common ip vulnerabilities
Beyond that, set up good logging and a trusted time source. Also, access lists to filter packets that should not be entering an interface, for example on int e0 block all but 10.10.10.0/24, depending on how paranoid you want to be. On external interface block private networks, loopback, multicast, etc.
HTH,

Sunday, 26 January 2014

Find Out Who's Eating Your Bandwidth With These Tips

A lot of things can drain away the capacity of that pipe that connects your computer to the Internet. It could be other people or devices on your network, or it could even be malicious applications or services running on the PC itself. The problem can get so bad that some people will toss out their computer and buy a new one.


http://www.makeuseof.com/tag/find-out-whos-eating-your-bandwidth-with-these-tips/

» How To Access the Developer Options Menu and Enable USB Debugging on Android 4.2

In Android 4.2, the Developer Options menu and USB Debugging option have been hidden. If you need to enable USB Debugging, you can access the Developer Options menu with a quick trick.

LXC – Fast virtualization with Linux containers – X86 and ARM

St├ęphane Graber explains how to get started with linux containers on Ubuntu 12.04 here:-

Creating a basic container and starting it on Ubuntu 12.04 LTS is now down to:
  sudo apt-get install lxc  
sudo lxc-create -t ubuntu -n my-container  
sudo lxc-start -n my-container
I needed this, because the container name was wrong.
sudo cp -rf my-container/ my-cloud-container/
This will default to using the same version and architecture as your machine, additional option are obviously available (–help will list them). Login/Password are ubuntu/ubuntu.
Container shuts down when the running system is shut down with the "halt" command.
Shut down a crashed container with:-
sudo lxc-stop -n my-container-name
It's now possible to use qemu-user-static with LXC to run containers of non-native architectures, ARM for example:
 sudo apt-get install lxc qemu-user-static 
sudo lxc-create -t ubuntu -n p3 -- -a armhf
 sudo lxc-start -n p3 -d


sudo lxc-attach -n p3
Use the code below to test your ARM gcc compiler.
#include
void main(void){
/* NOP */
asm ("mov r0, r0");
puts ("hello");
}
Save the code as test.c, compile with gcc test.c, and run with ./a.out.
It will put hello on the screen.