This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mysql> set global max_connections = 1000; | |
| Query OK, 0 rows affected (0.00 sec) | |
| mysql> show variables like "max_connections"; | |
| +-----------------+-------+ | |
| | Variable_name | Value | | |
| +-----------------+-------+ | |
| | max_connections | 1000 | | |
| +-----------------+-------+ | |
| 1 row in set (0.00 sec) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "github.com/mantyr/startstop" | |
| ) | |
| type Parser struct { | |
| startstop.StartStop // Start(), Stop(), Finish(), status, err := Next(), GetStatus() | |
| // ... other vars |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| How To Uninstall CrossOver Mac - https://www.youtube.com/watch?v=lWS65hceXt0 | |
| Все обновления и временные файлы хранятся тут: /Users/$user/Documents/World_of_Tanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ go test -run NONE -bench . -gcflags -ssa=0 > nossa.txt | |
| testing: warning: no tests to run | |
| $ go test -run NONE -bench . -gcflags -ssa=1 > ssa.txt | |
| testing: warning: no tests to run | |
| $ benchcmp nossa.txt ssa.txt | |
| benchmark old ns/op new ns/op delta | |
| BenchmarkAdd-4 2.45 11.4 +365.31% | |
| https://github.com/golang/go/issues/15925 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://play.golang.org/p/sopEgcwRZC | |
| package main | |
| import ( | |
| "fmt" | |
| "sync" | |
| ) | |
| type Map struct { | |
| sync.RWMutex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // http://play.golang.org/p/JlYJXZnUxl | |
| package main | |
| import ( | |
| "fmt" | |
| "net" | |
| ) | |
| func inet_aton(ip string) (ip_int uint32) { | |
| ip_byte := net.ParseIP(ip).To4() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import "fmt" | |
| func main() { | |
| c := make(chan int, 100) | |
| for i := 0; i < 34; i++ { | |
| c <- 0 | |
| } | |
| fmt.Println(len(c)) // print "34" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // изменить автора последнего коммита | |
| git commit --amend --author=username@example.com | |
| // запушить на github если там этот коммит уже был | |
| git push origin master -f | |
| // Изменение коммитов в Git - https://habrahabr.ru/post/201922/ | |
| Если нужно обновить свой форк данными из источника: | |
| 1. идём в свой форк, находим справа над списком файлов кнопку Compare |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "os" | |
| "path/filepath" | |
| ) | |
| func main() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // удалить файлы старше 3 дней | |
| find -type f -mtime +3 -exec rm -f {} \; | |
| // для случаев когда удалённый ftp сервер работает с ошибками, а файлы получить как-то нужно: | |
| // http://unix.stackexchange.com/questions/2525/sync-a-local-directory-with-a-remote-directory-in-linux | |
| curlftpfs -r -s ftp.foobar.com /foo | |
| rsync -a /foo/ /bar | |
| umount /foo | |
| // iTerm v2 |