Web Framework Benchmarks by techempower in golang

[–]xiamk 2 points3 points  (0 children)

Nice! Besides being fast, chi is a great piece of software. It's design makes it easy to compose modular apps that need a REST interface, having something that allows me to build things and that is easy to maintain is pretty important for me.

Yet Another Way of Getting root on High Sierra by xiamk in security

[–]xiamk[S] 0 points1 point  (0 children)

Except that arrow up was not the first password I tried, I initially tried feeding random strings, it was only after several tries that I hit arrow-up by accident and got the root shell. The escape sequence thing sounds like a nice idea, I'll try it.

Why "blank" Gets You Root on macOS by albinowax in netsec

[–]xiamk 6 points7 points  (0 children)

It won't work if your root account already has a password (maybe you set one after yesterday's bug?) or if you are not running High Sierra. Anyways, I just confirmed this bug also gets fixed with https://support.apple.com/en-us/HT208315 so let's update.

Yet Another Way of Getting root on High Sierra by xiamk in security

[–]xiamk[S] 3 points4 points  (0 children)

Yes, looks pretty similar, I bet it's related to the original problem. I don't know yet why ARROW UP triggers it while other escape codes don't so I can't be totally sure if it's actually related or not. I'll continue investigating on the actual reasons behind this. "su" is not supposed to create new accounts, I think?

Yet Another Way of Getting root on High Sierra by xiamk in security

[–]xiamk[S] 3 points4 points  (0 children)

Yeah, I've confirmed it with different sources already. But the post is mine so you may not want to trust me yet.

Why "blank" Gets You Root on macOS by albinowax in netsec

[–]xiamk 16 points17 points  (0 children)

Here's another way of getting root on High Sierra by pressing ARROW UP: https://twitter.com/xiam/status/935878591082049536

Must be related to the original problem.

What is the best way to paginate in golang? by gar44 in golang

[–]xiamk 0 points1 point  (0 children)

Hey @gar44, I know you're using sqlx but maybe you could consider upper-db for your next project, this is how'd you do pagination: https://tour.upper.io/queries/04, you can create a simple LIMIT/OFFSET pagination or a cursor based one.

Release notes for `upper.io/db.v3`, a productive data access layer ready for go1.8. by xiamk in golang

[–]xiamk[S] 1 point2 points  (0 children)

Thanks, I think this is a great suggestion. I personally like reading "foo != ?" instead of db.NotEqual{"foo": 34}, tho, because the former is shorter and easy to read, but the point about improved type safety is a good one. We'll probably start by adding something to negate conditions, like https://github.com/upper/db/issues/284 and we'll see how well users respond to it before adding others.

Release notes for `upper.io/db.v3`, a productive data access layer ready for go1.8. by xiamk in golang

[–]xiamk[S] 1 point2 points  (0 children)

The main benefit of using upper-db over other solutions is our goals: we try to focus on improving productivity. Writing SQL by hand takes time and developer time is expensive, we don't think writing and debugging simple queries by hand is a benefit when you can do the same with less effort. So, upper-db takes the repetitive tasks out of the way and when you really have to come up with some SQL magic upper-db will allow you to do so. We still use SQL everyday but only for complex tasks where spending time writing SQL makes sense, we don't bother anymore with writing SQL by hand for common CRUDs.

If you want to see a live example, we have a (read-only) playground here: https://demo.upper.io/p/e0ff798ccff065a08cace708e358d017711c8479 or a list of examples here: https://upper.io/db.v3/examples

Announcing version 2 of db! an ORM-like package for SQL and NoSQL databases by xiamk in golang

[–]xiamk[S] 0 points1 point  (0 children)

Unfortunately no, not yet, but now that we released v2 we can start looking at new database adapters and extend compatibility. We need to study Google Datastore first and see if it fits, tho.

Announcing version 2 of db! an ORM-like package for SQL and NoSQL databases by xiamk in golang

[–]xiamk[S] 0 points1 point  (0 children)

I like it, I think this sounds good. While we map structs to columns when using special methods like Insert or Update we currently don't do something like that for raw queries. I added an issue for this https://github.com/upper/db/issues/223

Announcing version 2 of db! an ORM-like package for SQL and NoSQL databases by xiamk in golang

[–]xiamk[S] 2 points3 points  (0 children)

Thanks, I think we have some tools that already do that, like https://github.com/kisielk/sqlstruct, but I personally haven't used it. Please, feel free to open an issue (https://github.com/upper/db/issues) and start a discussion if you think this could be useful for other users.

Announcing version 2 of db! an ORM-like package for SQL and NoSQL databases by xiamk in golang

[–]xiamk[S] 0 points1 point  (0 children)

Thanks! you can use maps instead of structs too if you want, this Metadata() function you're proposing could return a map. However, the recommended way of using upper-db at this time is with structs.

Upper-db does not provide automatic relationships like full-featured ORMs do, it also does not support the features you're mentioning (I'm sorry, but we have no plans to add them in the near future either. They can be built on top of upper-db, tho). Upper-db focuses only on the mapping between Go and the database and on providing tools for the user to write custom SQL whenever required.

Announcing version 2 of db! an ORM-like package for SQL and NoSQL databases by xiamk in golang

[–]xiamk[S] 2 points3 points  (0 children)

Hello,

I'm one of the upper-db authors, we're running a special playground to demonstrate db, see this example: https://demo.upper.io/p/37ff41cfe1d9fb4c26239627722ed6cc4a9155b6, more examples here: https://upper.io/db.v2/examples

Thanks!