The problem happens when a floated element is within a container box, that element does not automatically force the container’s height adjust to the floated element. When an element is floated, its parent no longer contains it because the float is removed from the flow. You can use 2 methods to fix it:

  • {clear: both}
  • clearfix

Here is the css code:

.clearfix:after {
    content: ".";
    display: block;
    clear: both;
    visibility: hidden;
    line-height: 0;
    height: 0;
}

.clearfix {
    display: inline-block;
}

html[xmlns] .clearfix {
    display: block;
}

* html .clearfix {
    height: 1%;
}

How does it work

Well you just add that to your CSS file and then you can use it as you would with normal class attribute like

<div class="clearfix">Content</div>

You can test the result using the below code snippet

<div class="clearfix" >
  <div style="float: left;">left</div>
  <div style="float: right;">right</div>
</div>


Refer here

Backup our sytem

sudo rsync -aAXv --delete --dry-run --exclude=/dev/* --exclude=/proc/* --exclude=/sys/* --exclude=/tmp/* --exclude=/run/* --exclude=/mnt/* --exclude=/media/* --exclude="swapfile" --exclude="lost+found" --exclude=".cache" --exclude="Downloads" --exclude=".ecryptfs" /source /destination

Change the partition format if needed

df -T /run/media/alu/alu

sudo unmount /dev/sdv1
sudo mkfs.ext4 /dev/sdb1 -L 'ALU'

lsblk

Restore the system

mkdir -p /mnt/usb/
mount /dev/sda1 /mnt/usb
rsync -aAXv --delete --exclude="lost+found" /mnt/usb/ /mnt/system

If you use pem file to access to remote ec2 address, usually it’s like below

ssh -i ubuntu.pem ubuntu@ip_address

But how to access the remote ec2 using just one line? For example, use sftp, ssh, scp command. You can achieve that by the following:

cat ~/.ssh/id_rsa.pub | ssh -i aws.pem ubuntu@ip_address “cat – >> ~/.ssh/authorized_keys”

1. set

sadd fans ff

sadd fans bb

sadd fans cc

sadd followers cc

smembers fans

srem fans ff

spop fans

scard fans                              # return the size of fans

sismember fans cc

sinter fans followers              # return the intersection of two sets

set foo 0                                   # add a new string

sinterstore foo fans                # 将’fans’的内容copy到’foo’中,并将’foo’转为set表

sinterstore foo fans followers         # 将’fans’和‘followers’的交集的内容copy到’foo’中,并将’foo’转为set表

srandmember(foo);

2. zset

zadd students 1 90

zadd students 2 85

zadd students 3 87

zadd students 4 93

zrange students 0 -1

zrangebyscore students 3 5

zcount students 3 5

zcard students

zscore students 87

zrank students 87

zremrangebyrank students 1 3

zadd teachers 1 85

zunionstore student_teachers students teachers

 

3. list

rpush foo bar

lpush foo bar1

rpushx foo bar

llen foo

lrange foo 0 -1

lindex foo 1

lset foo 1 123

lrem foo 1 _

lpop foo

rpop foo

linsert foo before bar before_bar

 

4. hash

hset table key1 v1

hget table key1

hexists table key1

hdel table key1

hlen table

hsetx table key1 v2

hmget table

hkeys table

hvals table

hgetall table

 

5. string

set str val

setex str 10 bar

setnx str 12

getset str 56

exists str

del str

type str

setrange str 0 abc

substr str 0 2

strlen str

randomkey

rename str str1

expire foo 1

ttl foo

dbsize

 

MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.
> config set stop-writes-on-bgsave-error no

eval "return redis.call('set','foo','bar')" 0 
eval "return redis.call('set',KEYS[1],'bar')" 1 foo
eval "return {1,2,{3,'Hello World!'}}" 0
eval "return redis.call('get','foo')" 0
eval "return {1,2,3.3333,'foo',nil,'bar'}" 0           # returns: 1,2,3,foo

 

Try the link here

Here is a copy of migration for two individual queries for logstash.conf:

input {
  jdbc {
    jdbc_connection_string => "jdbc:mysql://localhost:3306/testdb?useSSL=false&serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&rewriteBatchedStatements=true"
    # The user we wish to execute our statement as
    jdbc_user => "root"
    jdbc_password => "123456"
    # The path to our downloaded jdbc driver
    jdbc_driver_library => "E:\repo\mysql\mysql-connector-java\6.0.6\mysql-connector-java-6.0.6.jar"
    jdbc_driver_class => "com.mysql.cj.jdbc.Driver"
    # our query
    statement => "SELECT * FROM click_tripadvisor where rid > :sql_last_value"
    use_column_value => true
    tracking_column => "rid"
    jdbc_page_size => 1000
    jdbc_paging_enabled => true
    type => "click_tripadvisor"
    last_run_metadata_path => "C:\users\dt295\click_tripadvisor.logstash_jdbc_last_run"
    }

  jdbc {
    jdbc_connection_string => "jdbc:mysql://localhost:3306/testdb?useSSL=false&serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&rewriteBatchedStatements=true"
    # The user we wish to execute our statement as
    jdbc_user => "root"
    jdbc_password => "123456"
    # The path to our downloaded jdbc driver
    jdbc_driver_library => "E:\repo\mysql\mysql-connector-java\6.0.6\mysql-connector-java-6.0.6.jar"
    jdbc_driver_class => "com.mysql.cj.jdbc.Driver"
    # our query
    statement => "SELECT * FROM tracking_booking where id > :sql_last_value"
    use_column_value => true
    tracking_column => "id"
    jdbc_page_size => 1000
    jdbc_paging_enabled => true
    type => "tracking_booking"
    clean_run => "true"
    last_run_metadata_path => "C:\users\dt295\tracking_booking.logstash_jdbc_last_run"
    }
}
output {
  stdout { codec => json_lines }
  if[type] == "click_tripadvisor" {
    elasticsearch {
    "hosts" => "localhost:9200"
    "index" => "click_tripadvisor"
    "document_type" => "data"
    "document_id" => "%{rid}"
    }
  }

  if[type] == "tracking_booking" {
    elasticsearch {
    "hosts" => "localhost:9200"
    "index" => "tracking_booking"
    "document_type" => "tracking_booking"
    "document_id" => "%{id}"
    }
  }
}

 

 

 

1. install the shadowsocks server

wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks.sh

chmod +x shadowsocks.sh
./shadowsocks.sh 2>&1 | tee shadowsocks.log
vim /etc/shadowsocks.json

2.  configure the server side

{
    "server":"0.0.0.0",
    "server_port":8388,
    "local_address":"127.0.0.1",
    "local_port":1080,
    "password":"pass",
    "timeout":300,
    "method":"aes-256-cfb",
    "fast_open":false
}

3. expose the server_port to the remote host

4. related command

# start:
/etc/init.d/shadowsocks start

# stop: 
/etc/init.d/shadowsocks stop

# restart: 
/etc/init.d/shadowsocks restart

# status: 
/etc/init.d/shadowsocks status

 

Refer:

  1. Shadowsocks Python版一键安装脚本