change the system enveriment path under Ubuntu

commands:

 

$su root

 

$password

(system will request the root password)

 

 

$sudo gedit /etc/profile

(to open the folder and the can chenge the path already.)

 

 

have to change to the root permission, the profile can not be cant if it is normal user

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
如果你想要改变 Goka 默认的路径,你可以使用 `WithStorageBuilder` 方法来指定一个自定义的存储路径。具体来说,你需要实现 `goka.StorageBuilder` 接口,该接口包含一个 `BuildStorage` 方法,用于创建一个存储实例。在这个方法中,你可以使用自定义的存储路径来创建存储实例。 以下是一个示例代码: ```go package main import ( "fmt" "github.com/lovoo/goka" "github.com/lovoo/goka/storage" ) type customStorageBuilder struct { basePath string } func (b *customStorageBuilder) BuildStorage(topic string, partition int32) (storage.Storage, error) { // 使用自定义的路径 path := fmt.Sprintf("%s/%s/%d", b.basePath, topic, partition) return storage.NewDisk(path) } func main() { // 创建一个自定义存储路径的 StorageBuilder builder := &customStorageBuilder{ basePath: "/path/to/custom/storage", } // 使用自定义的 StorageBuilder 创建 ProcessorGraph g := goka.DefineGroup("my-group", goka.Input("my-input-topic", new(myInputCodec), handler), goka.Output("my-output-topic", new(myOutputCodec)), goka.Persist(new(myTableCodec), builder), ) // 创建一个新的 Processor p, err := goka.NewProcessor([]string{"localhost:9092"}, g) if err != nil { panic(err) } // 启动 Processor if err := p.Run(); err != nil { panic(err) } } ``` 在这个示例中,我们创建了一个 `customStorageBuilder` 结构体,它包含一个 `basePath` 字段,表示自定义的存储路径。在 `BuildStorage` 方法中,我们使用自定义的路径来创建存储实例。最后,我们使用自定义的 `customStorageBuilder` 来创建 `Persist` 方法的 Processor。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值