2,090 karma · joined Jun 12, 2019 (7y ago) · 709 submissions
[ my public key: https://keybase.io/nirui; my proof: https://keybase.io/nirui/sigs/oi8UKCZcYxKij-Pi43fDt35S1cHWmEKrFeMHZ4wW5Mo ]
comment 6y ago · link · parent
I got a Windows 10 Phone, and Edge is the only web browser that is available (Version 38.14393.2551.0 currently). According to my setting, Google should be the default search engine rather than Baidu which is an unremovable option for Chinese user.
However, from time to time (randomly I'd say), when I open Edge, the Baidu homepage pops up with a mystical tail "?tn=<a number>" in it's URL (while my setting is Google remind you).
Now, maybe you're thinking "Ha! this guy got a malwared Windows 10 Phone, kudos!". Well, guess what, thanks my slow Internet, I caught the redirector address hosted on go.microsoft.com right before it opens Baidu.
If you curl the address, which is https://go.microsoft.com/fwlink/?LinkId=625115 to be specific, you will found:
$ curl -v --head https://go.microsoft.com/fwlink/?LinkId=625115
......
* Server certificate:
* subject: C=US; ST=WA; L=Redmond; O=Microsoft Corporation; OU=Microsoft Corporation; CN=go.microsoft.com
* start date: Sep 6 19:37:21 2019 GMT
* expire date: Sep 6 19:37:21 2021 GMT
* subjectAltName: host "go.microsoft.com" matched cert's "go.microsoft.com"
* issuer: C=US; ST=Washington; L=Redmond; O=Microsoft Corporation; OU=Microsoft IT; CN=Microsoft IT TLS CA 5
* SSL certificate verify ok.
> HEAD /fwlink/?LinkId=625115 HTTP/1.1
> Host: go.microsoft.com
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 302 Moved Temporarily
HTTP/1.1 302 Moved Temporarily
< Content-Length: 0
Content-Length: 0
< Location: https://www.baidu.com/?tn=80035161_1_dg
Location: https://www.baidu.com/?tn=80035161_1_dg
......
Well, to be completely fair, it's not the dirtiest little game that they've played during their entire existence. And, at the very least, they are indeed redirecting me to the HTTPS service rather than HTTP one. So I guess I should thank them for the merciful and care?comment 6y ago · link · parent
Say you work as an anonymous contributor, and all the evidences which could proof the fact got accidentally destroyed, isn't that effectively relinquished your author rights? (Moved the right away from you, the right could still be there but licensed under an non-existing entity)
comment 6y ago · link · parent
See: https://rocket.rs/ https://actix.rs/
But, of course, the demo code is always easy. The real nightmare starts as soon as your application became complex enough, that the demo no longer fit and you need to manually spawn something (To handle TCP connection before it hits the framework for example) rather than just "actix_web::main" or "tokio::main".
comment 6y ago · link · parent
Not sure why that showed up in my first try :S
Anyway, I think the website can still be improved a bit:
It just recommended me another domain OverSteerable.com. Of course the domain itself was unregistered, but then I looked up a similar one OverSteer.com and this one turned out been registered in 1994.
I think similarity like this should be taken into account. Because when you tell people to go to "OverSteerable", they may end up misremembered it as "OverSteer".
comment 6y ago · link · parent
It can be called "Initial Connection Delay": Once a new TCP connection is established, wait for an uncertain number of n seconds before read and respond to the handshake request.
comment 6y ago · link · parent
See, they have a "Self Services" system under the HTTP path "/self_services", and the path to an user profile is formatted like "/username", the path to a repository is formatted like "/username/repositoryname".
So... (I think you've already guessed it)
- This is the URL to their Self Service: https://gitee.com/self_services
- Then, I registered a user named "self_services" (successfully, surprise!), and created a repository: https://gitee.com/self_services/test-repo. Yeah, that just happened.
I guess they are using a big global Routing Table instead of a staged one. Hope can get it they fixed, because it could be a hole in their security.
comment 6y ago · link · parent
See also: https://techcrunch.com/2020/08/21/china-is-building-its-gith...
comment 6y ago · link · parent
Not too big of a deal, but I'd imagine many users would take that into account when they're making chooses.
Link 1: https://www.docker.com/blog/scaling-dockers-business-to-serv...
comment 6y ago · link · parent
I saw @axegon_ talking about "Names From Other Languages" and calling it "worst thing that you could ever end up dealing with". But I tell you, a "Single Letter Name" master will turn your mind really quickly.
You open up the code, that's a file of over 2,000 lines, no comment. Everybody inside there were called `a`, `b`, `n`, `i`, `q`. Some functions were a little better, `handle`, `add`, `equal`, `DataClass`, `MainProcessHandler`, `Service`.
Yeah, I rewrite the whole thing because at least I can trust the stupidity of my own.
comment 6y ago · link · parent
You know we have a firewall that randomly disconnects connection and block traffic. A lots of apps just gets confused when that happened. And that happens a lot, once few minutes or shorter maybe.
When I work on my proxy, I had do define a new strategy to detect dead connections, such as to use separated timeout for Dial and Read. The Dial timeout will be a shorter value defaulted at 20 seconds, the Read timeout will be a rather normal one usually defaulted at 120 seconds.
I found many software just don't use any strategy. They just sends the connection and wait, assuming everything will be fine while it's actually hanging forever on user's end, until the OS kick them out. Many download system don't even have retry/resume mechanism: You downloaded 99% of a 600mb package (and it takes about 48 hours), then the connection EOF'ed, the software say "yeah you better download all of it again, hehe".
An example of good strategy can be found in `apt`. The software detects slow network, timed out connection, automatically retry downloads (not sure if it can resume download, could be great if it did). And all of that gives me a strong software that I can trust: I know when I run the command, the command will try it's best to get things done. And usually it did, causing far fewer issues than `npm`, `snap`, `git` and etc.
I suggest everybody give this mindset a try: When your software downloads data and puts it on user's computer, the copy of data is now owned by the user. You remove the data, you're looting the user from what they've got. It's like that you're making a dinner for your user: Everything been made (downloaded) is already on the table, one failed meal (packet) should not cause you to flipping the table. Instead, you retry and retry until it can't be done (For example, the source has changed or wait time is really too long).
comment 6y ago · link · parent
Because:
- The package is licensed through GPL
- The lib allocates memory in such way that it messed up my program
- The last update to the lib is 3 years ago, and it takes at least another 3 years for the author of the package get out of jail which is the min punishment of some NSL
- I don't like how it's interface is designed
- Because I got paid even I write everything by myself
The list goes on.
Another way to look at this is, "Do I really want just to implement a Linked-list? Or an sizable & queueable list that allow me to sort items via LRU?". Sometime, you just have to to write some "low level stuff" by yourself to make it exactly as you wanted.
comment 6y ago · link · parent
> ... lot project discovery has moved to other platforms, and more specifically, to Twitter. This isn’t good for the community.
Let me bring out my 2 points here:
#1: Hey, please ask your inner self why would you ever want to put out your own free labor out on the Internet in the first place? For common good? World peace?
I bet most people will answer: Be cool, be known, receive attention etc. Those GitHub stars&fork you've received will help you in your next job hunt, it will help you when you trying to introduce yourself to the other devs, it will help you to expand your people network. In short, those free labor generates something good for you.
But GitHub has it's own limits. On GitHub, your projects are discovered/used by other devs, a bubbles of it's own kind. Further, those devs might not even want to give you stars because they're above your level and/or found your project uninteresting to them.
Social medias generate those "good"s better than GitHub simply because it got wider range of people, and greater chance to found somebody who is interested to try out your project.
#2 and more important: The GitHub Trending page itself is really poor when it comes to discover new things.
Just think: What's on that page? "Most stared today" list. Well yeah, then where are those stars came from? Right?
It's a "Trending" page, that's it. Not a "Hey, checkout these exciting repositories recommended just for you" page and certainly not "Hey, come here and checkout my new repo which currently got zero star but it's really cool" page.
I personally found ProductHunt, Hacker News and Reddit is a better source if I do want to "Discover" something new. Which I guess is why people are posting their projects there (as well as on Twitter and Facebook and other platforms).
comment 6y ago · link · parent
1. There are ways to reduce it. For example incremental compiling, only recompile what's needed.
2. Many programmers already using CI when they're test/deploy/release their projects. And CI itself takes a long time to initialize and execute, basically throws away almost all the benefits of a fast compiler.
3. Let's don't forget the compiler could have different compile mode (Debug/Release mode), if Go wants to introduce it of course.
comment 6y ago · link · parent
Microsoft Windows however, is not that, at all.
Microsoft should hire that guy which could be a better ending, but they did not. MS played this game really un-well I must say.
comment 6y ago · link · parent
I'm a Chinese here, many "Digital immigrants"(1) from China uses Telegram as replacement to WeChat, because I guess it's groupchat feature.
However, Telegram itself is not a surveillance-avoidance/privacy protection tool of course, as you need a phone number to register, and an valid phone number is really hard to get anonymously.
Foot notes:
1: "Digital immigrants" means people who digitally lives outside the network border of their own country, not the dumb buzzword that Wikipedia tries to feed you
comment 6y ago · link · parent
Yesterday I was planing to randomly dig a hole in the game to mine whatever there is before go to sleep. Two minute into the digging, I found something blinking, it's "Sliver"! So I mined the whole chunk, look at the time (23:20) and decided to call it a day. But just before I quit the game, I noticed another chunk is blinking, turns out it's "Gold"(!!!) ... The pattern repeated until my clock says 1:40(!!!) Man! I'm over 30 years old now and that little game tricked me out of my schedule (!!!), again!
I think game like this is definitely designed to do that. They always trying to create an attraction loop so the player don't have chance to break out and quit the game.
Half-Life is not designed like that. In Half-Life, you have break points, for example, every time the loading screen shows, player may start to think "Hey, maybe I'll just pause here?". Plus, Half-Life gives you a lots of "Solitude moments", allowing you to break out the game during that.
Another thing I guess, is games like Minecraft and Terraria requires player to be able to immerse themselves into the game. Many people I know thinks Minecraft is a game that lets you "Cut trees and build houses. Boring!", not a single one of them would play the game for more than 5 minutes.
If you can pass that 5 minutes test, I guess then you probably have the ability to find some interesting things to do in the game all by yourself (Meaning you are a self-immersive kind person).
comment 6y ago · link · parent
Unrelated to Facebook, but some malicious SDK already doing it. For example, Igexin(https://blog.lookout.com/igexin-malicious-sdk), and it's not the only one.
Be careful when importing anything.
comment 6y ago · link · parent
Buying a phone that allows custom ROM is really beneficial. Not just it gives you more fre<Censored>edom and choose, it can also expand the lifespan of the device and thus save you a bit of money.
A side note: Fairphone looked quite nice, but that €450 price tag pushed me out far far away :(
comment 6y ago · link · parent
To someone who don't have it before, we're basically looking at a blur dot slightly larger than a peanut. But when you do it yourself, the memory you'll receive is priceless.
I strongly recommend everybody try it out when they have chance.
comment 6y ago · link · parent
See, if my lifespan is 4.5 billion years, then I can just sit here and wait until Andromeda become a daily light show when it finally got close enough.
Look through a live telescope yourself will give you a very VERY different feeling when compare to look at a picture on NASA website.
I have an amateur telescope, 130EQ. I still remember the feeling it give to me when the first time it brought Saturn into my view, and then again for Jupiter, stars and clusters ...
For me, the best way to get over all the unhappiness, anger and depressions, is to sit down in the pitch dark of the night, setup the telescope and hunting for the stars.
Sadly I managed to broke it's tripod few years back :(
comment 6y ago · link · parent
I can't read the pay-walled ft.com article, but I been hearing people say "kill-switch" on the topic. If there will be a "kill-switch" builtin in the protocol, does that means the "New network" will be more centralized and thus unstable and bad?
I think if the goal is to connect more devices, why not build a completely decentralized P2P network that is cheap, easy to maintain, and user-friendly?
comment 6y ago · link · parent
The real evil I think is when somebody starts to use roadmap like this one to measure other people. Don't do that, my dear comment readers, roadmap is a better tool when you use it against yourself, not the others.
comment 6y ago · link · parent
I cloned your project and made a Dockerfile for it. It works on my Arm32 based board so I guess it should work on other platforms as well.
The file is here, should be a good starting point if you want to further develop the Docker image, please test it:
# This is an experimental Dockerfile for Sorcia Git front-end
#
# This image allows both easy deployment and use. The deployer
# can operate the resulting container via Docker remote management
# with command such as:
#
# `docker -H <docker_server> exec sorcia /home/git/sorcia/sorcia usermod`
#
# to manage the service rather than having to login onto the Docker
# host.
#
# To build the image, use command
#
# `docker build --tag <final_image_name> .`
#
# Or, setup a hook on Docker cloud, let it do the hard job for you.
#
# To run the image, use command:
#
# `docker run \
# --detach \
# --restart always \
# --name sorcia \
# --publish 1937:1937 \ # You may have to change this port number
# --publish 2222:2222 \ # iptables maybe needed if you want port 22
# <final_image_name> web`
#
# To run usermod, when the container is running, run:
#
# `docker exec -it <container_name> /home/git/sorcia/sorcia usermod`
#
# Notice: This image does not contain Nginx, if you need it, put it in
# a separate container.
#
# Step 1: Initialize the build enviroment and build the application
#
# Here we are using the golang:alpine which is the latest Go but
# is compiled for Alpine. This is necessary because we will later
# run the service on an Alpine base (musl based).
#
# Step 1.0: Copy all source file into the container
# Step 1.1: Install Git to download go modules, and build-base to
# build the dependencies
# Step 1.2: Print the version of the bulitin Go
# Step 1.3: Goto /sorcia directory and start the building process
#
FROM golang:alpine as builder
COPY . /sorcia
RUN set -ex && \
until apk add build-base git sqlite-dev; do sleep 1; done && \
([ -z "$HTTP_PROXY" ] || (git config --global http.proxy "$HTTP_PROXY")) && \
([ -z "$HTTPS_PROXY" ] || (git config --global https.proxy "$HTTPS_PROXY")) && \
go version && \
cd /sorcia && \
until CGO_ENABLED=1 go build; do sleep 1; done
# Step 2: Setup the image that will actually run the service
#
# Step 2.0: Copy the generated binary along with source file into
# the container
# Step 2.1: Install the dependencies: Git and Sqlite
# Step 2.2: Create user and user group git and sorcia, we'll run the
# service application under user sorcia
# Step 2.3: Initialize the enviroment (Directory and other stuff)
#
FROM alpine:latest
COPY --from=builder /sorcia /home/git/sorcia
RUN set -ex && \
ls -l /home/git/sorcia && \
cp /home/git/sorcia/config/app.ini.sample /home/git/sorcia/config/app.ini && \
sed -i -E "s/ssh_port.+\=.+/ssh_port = 2222/" /home/git/sorcia/config/app.ini && \
echo && cat /home/git/sorcia/config/app.ini && echo && \
until apk add --no-cache openssh git sqlite; do sleep 1; done && \
addgroup -S sorcia && adduser -S -G sorcia sorcia && \
mkdir -p /home/git/data && chown sorcia:sorcia /home/git/data && \
chmod +x /home/git/sorcia/sorcia && \
(cd /home/git/sorcia; rm error.log -f; ln -s /tmp/error.log error.log; ./sorcia version)
WORKDIR /home/git/sorcia
USER sorcia
EXPOSE 1937 2222
ENTRYPOINT [ "/home/git/sorcia/sorcia" ]
CMD []comment 6y ago · link · parent
My questions:
- Can you make it a drop-and-play Docker image?
- Why not host JavaScripts like `highlight.js` directly on the Sorcia server? That way LAN-only user will be able use this software as well.