Skip to content
/ Tips Public

Here are some tips and notes on programming.

Notifications You must be signed in to change notification settings

ryansoq/Tips

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

Tips

Here are some tips and notes on programming.

ssh2docker

docker pull ubuntu:latest
docker run -it --privileged=true -p 50022:22 --name ubuntu ubuntu bash
apt-get update
apt-get install vim	
apt-get install git	
apt-get install net-tools
apt-get install openssh-server
echo "Port 22" >>/etc/ssh/sshd_config
echo "PermitRootLogin yes" >>/etc/ssh/sshd_config
service ssh start	
service ssh status
systemctl enable ssh

echo "#!/bin/bash" >> ssh_auto_start.sh
echo "service ssh start" >> ssh_auto_start.sh
echo "service ssh status" >> ssh_auto_start.sh

chmod 755 ~/ssh_auto_start.sh

echo "~/ssh_auto_start.sh" >> /root/.bashrc

passwd

ssh connection

ssh [email protected] -p 50022

  • Other target

ipconfig # use this command e.g. 192.168.1.xxx

ssh -p 50022 [email protected]

use static ip

  • IP address: 192.168.1.99
  • Subnet mask: 255.255.255.0
  • Gateway: 192.168.1.1
  • DNS server: 8.8.8.8

add ssh key

ssh-keygen -t rsa -b 4096 -C "[email protected]"
cat /root/.ssh/id_rsa.pub

clang format

if clang-format --version &> /dev/null
then
   clang-format -style=WebKit -i main.cc
   clang-format -style=WebKit -i example.cc
fi
// clang-format -style=file -i activations.h

About

Here are some tips and notes on programming.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published