ubuntu 配置url地址重定向协议

参考网址:

http://blog.csdn.net/eroswang/article/details/1594795

http://hi.baidu.com/pluto632/item/5007737da31344326f29f666

http://msdn.microsoft.com/en-us/library/aa767914.aspx#prot_sec

http://msdn.microsoft.com/en-us/library/ie/aa767914(v=vs.85).aspx

http://kb.mozillazine.org/Register_protocol

http://superuser.com/questions/162092/how-can-i-register-a-custom-protocol-with-xdg

https://support.shotgunsoftware.com/entries/86754-How-to-launch-external-applications-using-custom-protocols-rock-instead-of-http-

针对ubuntu

1:

All Firefox versions
(Requires certain Gnome libraries to be installed)
In a terminal, type:
gconftool-2 -s /desktop/gnome/url-handlers/foo/command '/path/to/app %s' --type String
gconftool-2 -s /desktop/gnome/url-handlers/foo/enabled --type Boolean true
Replace foo on both lines with the protocol you want to register and /path/to/app with the path to the application you want to run.

以上如果不行,可以试试一下操作
gconftool-2 -t string -s /desktop/gnome/url-handlers/foo/command 'foo "%s"'
gconftool-2 -s /desktop/gnome/url-handlers/foo/needs_terminal false -t bool
gconftool-2 -s /desktop/gnome/url-handlers/foo/enabled true -t bool

2:

在firefox地址栏输入about:config,出现如下界面

之后firefox version >3.5 执行一下操作

在preference name 下面,右键-》new,选择不同的类型建立不同的值

主要是如下几个值:

最后的testfile,要替换成你自己的协议。

并且要确保network.protocol-handler.expose-all 为true

 

3.

  建立应用程序的桌面文件:/usr/share/applications/testfile.desktop (文件名称应该要与协议名称一样)

  内容如下:

[Desktop Entry]
Encoding=UTF-8
Name=testfile
Comment=testfile
Exec=/home/ubuntu/workspace/test_file/Debug/test_file %u
Terminal=false
StartupNotify=true
Type=Application
Categories=Application;Internet;
Name[en_US]=testfile

   之后在 /etc/gconf/gconf.xml.defaults/%gconf-tree.xml文件中添加以下内容

x-cheme-handler/testfile=testfile.desktop
application/x-testfile=testfile.desktop
application/testfile=testfile.desktop

    然后在~/.local/share/applications/mimeapps.list文件中添加以下内容

[Default Applications]            //这一行必须要有
x-scheme-handler/testfile=testfile.desktop application/x-testfile=testfile.desktop application/testfile=testfile.desktop

4.

   之后在firefox地址栏中输入testfile://就能弹出你想要打开的程序

转载于:https://www.cnblogs.com/flyingdirt/p/3776903.html

Ubuntu系统中配置IP地址可以通过几种不同的方法实现。一种方法是使用图形用户界面(GUI)进行配置,另一种方法是通过命令行进行配置。 如果你使用的是Ubuntu的桌面版本,你可以按照以下步骤使用GUI进行IP地址配置: 1. 点击右上角的网络图标,选择“Wi-Fi设置”或“有线设置”,打开网络设置窗口。 2. 在网络设置窗口中,选择你要配置的网络连接(无线或有线)。 3. 点击“设置”按钮,在弹出的对话框中选择“IPv4”选项卡。 4. 在IPv4选项卡中,选择“手动”作为IP地址的获取方式。 5. 输入你想要配置的IP地址、子网掩码和网关地址。 6. 如果需要,你还可以指定DNS服务器地址。 7. 点击“应用”或“保存”按钮,保存配置并关闭窗口。 如果你使用的是Ubuntu的服务器版本,你可以按照以下步骤使用命令行进行IP地址配置: 1. 打开终端窗口。 2. 使用以下命令编辑网络接口配置文件(以eth0为例,根据你的网络接口名称进行相应调整): ``` sudo nano /etc/network/interfaces ``` 3. 在文件中找到与你的网络接口相关的行,并将其修改为以下内容(假设你要配置的IP地址是192.168.0.10,子网掩码是255.255.255.0,网关是192.168.0.1): ``` auto eth0 iface eth0 inet static address 192.168.0.10 netmask 255.255.255.0 gateway 192.168.0.1 ``` 4. 保存文件并退出编辑器。 5. 使用以下命令重启网络服务,使配置生效: ``` sudo systemctl restart networking ``` 无论你选择使用GUI还是命令行进行IP地址配置,确保你输入的IP地址、子网掩码和网关等信息是正确的,以确保网络连接正常。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值