Forum Index


Board index » All Posts




Re: Iptables 指南 1.1.19
#1
Not too shy to talk
Not too shy to talk


#修改V2ray客户端配置文件 inbounds 增加如下代码,其余部分保持不变
"inbounds": [{
"domainOverride": ["tls", "http"],
"listen": "0.0.0.0",
"port": 12345,
"protocol": "dokodemo-door",
"settings": {
"followRedirect": true
},
"streamSettings": {
"sockopt": {
"mark": 100,
"tcpFastOpen": true,
"tproxy": "tproxy"
}
}
}]

#V2ray设置透明代理

#设置iptable 送流量给V2ray的Dokodemo Door
#增加下面代码到/etc/rc.local
sleep 20
GW=`netstat -rn|grep '0.0.0.0'|awk '{print $2}'|head -1`
HOST_IP=$(ifconfig |grep broadcast |awk '{print $2}')
sudo ip rule add fwmark 0x01/0x01 table 100
sudo ip route add local 0.0.0.0/0 dev lo table 100
sudo iptables -t mangle -N V2RAY
sudo iptables -t mangle -I V2RAY -d 192.168.0.0/16 -j RETURN
sudo iptables -t mangle -I V2RAY -d $GW/32 -j RETURN

for line in $HOST_IP
do
#echo $line
sudo iptables -t mangle -I V2RAY -d $line/32 -j RETURN
done

sudo iptables -t mangle -I V2RAY -d 127.0.0.1/32 -j RETURN
sudo iptables -t mangle -A V2RAY -p udp -j TPROXY --on-port 12345 --tproxy-mark 0x01/0x01
sudo iptables -t mangle -A V2RAY -p tcp -j TPROXY --on-port 12345 --tproxy-mark 0x01/0x01
sudo iptables -t mangle -A PREROUTING -j V2RAY


Posted on: 11/27 8:36
Top


ubuntu desktop automatically shutdown 定时开关机
#2
Not too shy to talk
Not too shy to talk


ubuntu 桌面版本 定时关机

vim /etc/crontab


30 02 * * * root /sbin/shutdown -h now


编辑 /etc/crontab添加一条命令:55 23 * * * root /sbin/shutdown -h now。即可实现每天23:55关机。


编辑 /etc/crontab添加一条命令:52 23 * * * root /sbin/shutdown -r 08:00。即可实现每天23:55关机,早上8点开机。

Posted on: 11/24 6:11
Top


android ntp server
#3
Not too shy to talk
Not too shy to talk


原生android 无法连接网络

修改 ntp server

一、给盒子开启调试模式

选择盒子系统设置里的版本号一直点确认就能开启调试模式

二、通过adb工具连接盒子

adb connect 192.168.0.121

端口可以不写会默认加上5555,连接成功会提示成功,但光标处还是系统路径。

adb shell settings get global ntp_server 
#查看现在的时间同步服务器
adb shell settings put global ntp_server ntp.aliyun.com
#更新为阿里云的时间同步服务器

三、给盒子关闭调试模式

调试模式一般不要开


Posted on: 11/23 2:56
Top


ssh tunnel
#4
Not too shy to talk
Not too shy to talk


Secure SHell (SSH) 是一个通过网络登录其他计算机的程序,在远程服务器运行命令,和从一台机器移动文件到另一台。在不安全的网络中,它提供两台主机之间强大认证和安全加密的的通讯,被称为 SSH Port Forwarding (Tunneling)。通常情况下,它是使用为一个 Telnet 的加密版本。

在一个 Telnet 阶段作业,全部的通讯,包括用户名和密码,会用纯文本传输,让任何人都能监听你的阶段作业及窃取密码或其他信息。这种阶段作业也容易受到阶段作业劫持,一旦你验证,恶意用户就能接管这种阶段作业。SSH 的目的是防止这种漏洞,并允许你在不影响安全性的情况下访问远程服务器的 shell。

SSH 通道的好处

SSH 有一个极好功能叫做 SSH Port Forwarding,有时也被称为 SSH 通道,它允许你创建一个安全的阶段作业,然后通过它打开随心所欲的 TCP 连接。通道可以随时创建,几乎不需要任何努力及编程,这令到它们非常有吸引力。在无数不同的方式,SSH Port Forwarding 可以用于安全通信。

许多提供服务器讬管的讬管公司会封锁讬管公司网络以外访问服务器,以及只授予访问給本机(localhost)用户连接。

使用 SSH 的多个好处:

@当服务器端口被封锁时,连接到使用了防火墙的服务器。

@自动验证用户,没有发送纯文本的密码,以防止窃取密码。

@多个强大的认证方法,防止安全威胁如欺骗的身份。

@安全和快速的加密和压缩数据。

@安全文件传输。

为确保进来的连接请求是由你发出,SSH 能够使用密码,或公开及私钥对(也称为公钥)验证机制。

@密码验证。

@公钥验证。

注意:请确保在Linux 服务器的参数 -「AllowTcpForwarding」设置值为「yes」,否则,会禁用 SSH port forwarding。要查找路径:/etc/ssh/sshd_config。在默认情况下,SSH port forwarding 应该已启用。请仔细检查该值的设置。

** 即使服务器支持 SSH 通道,然而,如果 port forwarding 被禁用,Navicat 就无法通过 SSH 端口 22 连接。

1.

复制代码
复制代码
SSH: Port Forwarding
1.正向隧道-隧道监听本地port,为普通活动提供安全连接
ssh -qTfnN -L port:host:hostport -l user remote_ip
2.反向隧道----隧道监听远程port,突破防火墙提供服务
ssh -qTfnN -R port:host:hostport -l user remote_ip
3.socks代理
SSH -qTfnN -D port remotehost(用证书验证就直接主机名,没用的还要加上用户名密码)
-q Quiet mode. 安静模式,忽略一切对话和错误提示。
-T Disable pseudo-tty allocation. 不占用 shell 了。
-f Requests ssh to go to background just before command execution. 后台运行,并推荐加上 -n 参数。
-n Redirects stdin from /dev/null (actually, prevents reading from stdin). -f 推荐的,不加这条参数应该也行。
-N Do not execute a remote command. 不执行远程命令,专为端口转发度身打造。
复制代码
复制代码
2.

复制代码
复制代码
ssh实现转发, 只要用到以下两条命令:

# ssh -CfNg -L 6300:127.0.0.1:1521 oracle@172.16.1.164
# ssh -CfNg -R 1521:127.0.0.1:6300 oracle@172.16.1.164

不论是做跳板, 还是加密隧道, 还是加密其他的网络连接也都是这两条命令. 视具体情况而定, 有时只要用到其中一条, 有时两条都要用到.

命令解释:

1) -CfNg

C表示压缩数据传输
f表示后台用户验证,这个选项很有用,没有shell的不可登陆账号也能使用.
N表示不执行脚本或命令
g表示允许远程主机连接转发端口

2) -L 本地转发

# ssh -CfNg -L 6300:127.0.0.1:1521 oracle@172.16.1.164

本机(运行这条命令的主机)打开6300端口, 通过加密隧道映射到远程主机172.16.1.164的1521端口(使用远程主机oracle用户). 在本机上用netstat -an|grep 6300可看到. 简单说,本机的6300端口就是远程主机172.16.1.164的1521端口.

3) -R 远程转发

# ssh -CfNg -R 1521:127.0.0.1:6300 oracle@172.16.1.164

作用同上, 只是在远程主机172.16.1.164上打开1521端口, 来映射本机的6300端口.

4) 实用例子

有A,B,C 3台服务器, A,C有公网IP, B是某IDC的服务器无公网IP. A通过B连接C的80端口(A<=>B<=>C), 那么在B上执行如下命令即可:

$ ssh -CfNg -L 6300:127.0.0.1:80 userc@C
$ ssh -CfNg -R 80:127.0.0.1:6300 usera@A

服务器A和服务器C之间, 利用跳板服务器B建立了加密隧道. 在A上连接127.0.0.1:80, 就等同C上的80端口. 需要注意的是, 服务器B上的6300端口的数据没有加密, 可被监听, 例:

# tcpdump -s 0-i lo port 6300
复制代码

新建一个ssh代理:

ssh -CfNg -L 6000:127.0.0.1:22 root@120.18.28.28

本机6000代理到远程22.

运行命令后可用看到有进程:

tcp 0 0 0.0.0.0:62667 0.0.0.0:* LISTEN 27449/ssh

测试是否可用

ssh -p 6000 root@localhost -v

如果不可用会报错,常见的错误有:

ssh_exchange_identification: Connection closed by remote host

这个说明远程主机名单设置有问题。


Posted on: 11/20 3:16
Top


ffmpeg webm mp4
#5
Not too shy to talk
Not too shy to talk


ffmpeg -i input.mkv -map 0 -c:s mov_text -metadata:s:s:0 language=eng -metadata:s:s:1 language=eng -cpu-used 8 -crf 22 -c:v libx265 output.mp4

Posted on: 10/30 3:39
Top


ubuntu 20.04 php7.2
#6
Not too shy to talk
Not too shy to talk


ubuntu 20.04 php7.2

export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/

./configure --prefix=/usr/local/php72 --with-config-file-path=/usr/local/php72/etc --with-pdo-mysql --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --with-zlib --with-bz2 --with-curl --with-libxml-dir --with-mhash --enable-mbstring --enable-xml --enable-sockets --enable-zip --enable-bcmath

make && make install


cd ext/gd

/usr/local/php552/bin/phpize

./configure --with-php-config=/usr/local/php72/bin/php-config --with-jpeg-dir --with-png-dir --with-freetype-dir --with-webp-dir

Makefile line 32

CPPFLAGS = -I/usr/include/freetype2/ -DHAVE_CONFIG_H

make && make install

我在编译安装 PHP 时,遇到了 “freetype-config not found”的问题。
主要的思路就是用pkg-config代替freetype-config

sed -i "s/freetype-config/pkg-config/g" ./configure
sed -i "s/freetype-config/pkg-config/g" ./config.m4
sed -i "s/FREETYPE2_CONFIG --cflags/FREETYPE2_CONFIG freetype2 --cflags/g" ./configure
sed -i "s/FREETYPE2_CONFIG --libs/FREETYPE2_CONFIG freetype2 --cflags/g" ./configure

Posted on: 9/30 6:00

Edited by eyex on 2020/9/30 6:51:32
Top


Re: ubuntu dns clear
#7
Not too shy to talk
Not too shy to talk


Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/68.0

Posted on: 9/18 14:42
Top


Re: just give me a reason
#8
Not too shy to talk
Not too shy to talk


I have walked all alone
独自一人漫步
On these streets I call home
行走在这些我称为家的街区
Streets of hope Streets of fear
希望和恐惧并存
Through the sidewalk cracks time disappears
时间穿过人行道上的裂缝悄悄流逝
I was lost, on my knees
我已输掉,跪地投降
On the eve of defeat
在那失败的前夜
As I choked back the tears
当我拼命忍住泪水
There's a silent scream no one could hear
那没人能听到的无声呐喊
So far away from everything you know is true
离那些你所知的一切真实如此遥远
Something inside that makes you do what you got to do
那深埋内心的跃动,带你走向你的使命
Ring the bells Ring them loud
敲响那钟声 大声敲响它们
Let them ring here and now
让它们即刻奏响
Just reach out and ring the Bells of Freedom
就敲响那自由之钟让自由之声飘扬
When your world's crashing down
当你的世界正在坠落
Like you're lost every round
就像你输掉了每一回合
Stand your ground
坚守你的信念
And ring the Bells of Freedom
敲响那自由之钟
Up the steps of the church Through the fields and the dirt
穿过那尘土之地踏上教堂的台阶
In the dark I have seen
在黑暗中我已看到
That the sun still shines for the one who believes
太阳依然照耀那些坚信的人们
So far away
如此遥远
So full of doubt and needing proof
满是疑惑不解
Just close your eyes and hear the sounds inside of you
那就闭上眼睛听你内心的呼喊
Ring the bells Ring them loud
敲响那钟声 大声敲响它们
Let them ring here and now
让他们立即鸣响
Just reach out and ring the Bells of Freedom
就敲响那自由之钟让它的声音得以延伸
When your world's crashing down
当你的世界正在坠落
Like you're lost every round
就像你输掉了每一回合
Stand your ground
坚守你的信念
And ring the Bells of Freedom
敲响那自由之钟
Ring the bells Ring them loud
敲响那钟声 大声敲响它们
Let them ring here and now
让它们立即鸣响
Just reach out and ring the Bells of Freedom
就敲响那自由之钟让自由之声飘扬
Yeah!
是的!
When your world's crashing down
当你的世界正在坠落
Like you're lost every round
就像你输掉了每一回合
Stand your ground
坚守你的信念
And ring the Bells of Freedom
敲响那自由之钟
Ring the bells Ring them loud
敲响那钟声 大声敲响它们
Let them ring here and now
让它们立即鸣响
Just reach out and ring the Bells of Freedom
就敲响那自由之钟让自由之声飘扬

Posted on: 8/21 5:41
Top


Re: just give me a reason
#9
Not too shy to talk
Not too shy to talk


Lately I've been, I've been losing sleep
Dreaming 'bout the things that we could be
But baby I've been prayin' hard
Said no more counting dollars
We'll be counting stars
Yeah, we'll be counting stars
I see this life
Like a swinging vine
Swing my heart across the line
In my face is flashing signs
Seek it out and ye shall find
Old, but I'm not that old
Young, but I'm not that bold
And I don't think the world is sold
I'm just doing what we're told
I, feel something so right
But doing the wrong thing
I, feel something so wrong
But doing the right thing
I could lie, could lie, could lie
Everything that kills me makes me feel alive
Lately I've been, I've been losing sleep
Dreaming 'bout the things that we could be
Baby I've been, I've been prayin' hard
Said no more counting dollars
We'll be counting stars
Lately I've been, I've been losing sleep
Dreaming 'bout the things that we could be
Baby I've been, I've been prayin' hard
Said no more counting dollars
We'll be, we'll be counting stars
I feel the love
And I feel it burn
Down this river every turn
Hope is a four letter word
Make that money
Watch it burn
Old, but I'm not that old
Young, but I'm not that bold
And I don't think the world is sold
I'm just doing what we're told
I, feel something so wrong
But doing the right thing
I could lie, could lie, could lie
Everything that drowns me makes me wanna fly
Lately I've been losing sleep
Dreaming 'bout the things that we could be
Baby I've been, I've been prayin' hard
Said no more counting dollars
We'll be counting stars
Lately I've been, I've been losing sleep
Dreaming 'bout the things that we could be
Baby I've been, I've been prayin' hard
Said no more counting dollars
We'll be, we'll be counting stars
Take that money
And watch it burn
Sink in the river
The lessons I learnt
Everything that kills me makes me feel alive
Lately I've been, I've been losing sleep
Dreaming 'bout the things that we could be
Baby I've been, I've been prayin' hard
Said no more counting dollars
We'll be counting stars

Posted on: 8/21 5:41
Top


just give me a reason
#10
Not too shy to talk
Not too shy to talk


Right from the start
  You were a thief
  You stole my heart
  And I your willing victim
  I let you see the parts of me
  That weren’t all that pretty
  And with every touch you fixed them
  Now you’ve been talking in your sleep oh oh
  Things you never say to me oh oh
  Tell me that you’ve had enough
  Of our love, our love
  Just give me a reason
  Just a little bit’s enough
  Just a second we’re not broken just bent
  And we can learn to love again
  It’s in the stars
  It’s been written in the scars on our hearts
  We’re not broken just bent
  And we can learn to love again
  I’m sorry I don’t understand
  Where all of this is coming from
  I thought that we were fine
  (Oh we had everything)
  Your head is running wild again
  My dear we still have everythin’
  And it’s all in your mind
  (Yeah but this is happenin’)
  You’ve been havin’ real bad dreams oh oh
  You used to lie so close to me oh oh
  There’s nothing more than empty sheets
  Between our love, our love
  Oh our love, our love

Just give me a reason
  Just a little bit’s enough
  Just a second we’re not broken just bent
  And we can learn to love again
  Oh I’ll never stop
  You’re still written in the scars on my heart
  You’re not broken just bent,
  And we can learn to love again
  Oh tear ducts and rust
  I’ll fix it for us
  We’re collecting dust
  But our love’s enough
  You’re holding it in
  You’re pouring a drink
  No nothing is as bad as it seems
  We’ll come clean

Just give me a reason
  Just a little bit’s enough
  Just a second we’re not broken just bent
  And we can learn to love again
  It’s in the stars
  It’s been written in the scars on our hearts
  That we’re not broken just bent
  And we can learn to love again

Just give me a reason
  Just a little bit’s enough
  Just a second we’re not broken just bent
  And we can learn to love again
  It’s in the stars
  It’s been written in the scars on our hearts
  That we’re not broken just bent
  And we can learn to love again
  Oh, we can learn to love again
  Oh, we can learn to love again
  Oh oh, that we’re not broken just bent
  And we can learn to love again

Posted on: 8/21 5:40
Top



TopTop
1 2 3 4 5 »



Themes

(2 themes)
Login
Username:

Password:


Lost Password?
Register now!
Categories