Live data from Hacker News

My server is a phone now

seg6.space

261–270 of 272 posts

Re: My server is a phone now

#262
post #126

Earlier quoted context omitted.

What's wrong with Docker desktop? Been using it everyday for at least 5 years.

It’s sluggish, it’s incredibly bloated with all the services that Docker (the company) wants to sell you and the UI is badly designed. OrbStack is my go-to when it comes to running docker on Mac. It also uses macOS native containerization APIs so containers will be a bit more performant than they would (at least use to) be on Docker Desktop. Another good approach if you’re fine without a GUI or want to bring your own…

The main gotcha I encountered with orbstack was with pulling down internally built amd64 images and trying to run them on apple silicon. I just remember constantly running into issues and going back to docker desktop as a result, even if their solution is janky in its own way.

Re: My server is a phone now

#263

Just a heads up, proxmox now supports ARM, so with the authors setup, it could potentially run Proxmox along with LXC for containers. LXC does provide a security boundary, more than Docker but less than a full blown VM.

any guides on transorming an android phone into a proxmox node?

It's only just become available for ARM, so I doubt there's much information out there yet.

Re: My server is a phone now

#264

Earlier quoted context omitted.

Is it not worth the effort to take them apart and take the batteries out before you put them into the rack?

A lot of phones nowadays are glued shut, you'll budget for a trained repair tech to do that. They also use the battery as a giant capacitor to absorb spike draws that wall chargers cannot provide, so the modified device will need that capacity as well. Finally, there will be some radio certification ambiguity as to whether it's legal for a legal company to operate. That said... there are Chinese rackable phone KVM th…

any way to find those rackable phone kvm things? My quick search came up empty. I might get someone interested in that. However, we're a very big European corporation, so "let's use social media fraud farms" and "hire talent from scam malls to build them" might not fly in a meeting :P

Re: My server is a phone now

#265
post #230

Earlier quoted context omitted.

Here is a secret, you don't need containers for server software, we have been doing it for decades. Yes there are ways to bind to server ports with official APIs, example can be requested to Fable, Claude, or whoever you feel like it.

What do you mean? Android blocks apps from binding to ports which is what apache httpd does unless you root. I would be asking Claude for an exploit to unlock the bootloader so I can root Also, you can't install things on termux if you have android 6 or below. You must install postmarketos and thus an unlocked bootloader.

Not if the application has the right permissions on their installation manifest.

Then you need to write the server handling code on a background application thread, with perfectly working server sockets.

This only works on wlan, or local network when using bluethooth, but who wants data modem for a server anyway.

With Gemini's compliment,

    import kotlinx.coroutines.Dispatchers
    import kotlinx.coroutines.withContext
    import java.io.BufferedReader
    import java.io.InputStreamReader
    import java.net.ServerSocket
    import java.net.Socket
    import java.net.SocketException

    class AndroidTcpServer {

        private var serverSocket: ServerSocket? = null
        private var isRunning = false

        // Call this function from a CoroutineScope (e.g., lifecycleScope.launch)
        async suspend fun startServer(port: Int = 8080) {
            withContext(Dispatchers.IO) {
                try {
                    serverSocket = ServerSocket(port)
                    isRunning = true
                    
                    // Loop to continuously accept incoming client connections
                    while (isRunning) {
                        val clientSocket = serverSocket?.accept() // Blocks until a client connects
                        
                        if (clientSocket != null) {
                            // Handle each client connection in a separate background routine
                            handleClient(clientSocket)
                        }
                    }
                } catch (e: SocketException) {
                    // Triggered when stopServer() closes the socket
                    println("Server socket closed: ${e.message}")
                } catch (e: Exception) {
                    e.printStackTrace()
                } finally {
                    stopServer()
                }
            }
        }

        private suspend fun handleClient(socket: Socket) {
            withContext(Dispatchers.IO) {
                try {
                    val reader = BufferedReader(InputStreamReader(socket.getInputStream()))
                    val outputStream = socket.getOutputStream()

                    // Read incoming text from client
                    val incomingMessage = reader.readLine()
                    println("Received from client: $incomingMessage")

                    // Send a simple response back to the client
                    val response = "Hello from Android Server!\n"
                    outputStream.write(response.toByteArray())
                    outputStream.flush()

                } catch (e: Exception) {
                    e.printStackTrace()
                } finally {
                    // Always close individual client connections
                    socket.close()
                }
            }
        }

        fun stopServer() {
            isRunning = false
            try {
                serverSocket?.close()
            } catch (e: Exception) {
                e.printStackTrace()
            }
        }
    }

As you might imagine by my comment history, I am a big fan of letting Android be Android, with Android native apps, not stuffing GNU/Linux into an APK.

Re: My server is a phone now

#266
post #149

It is incredible the amount of gimmicks some folks will go through, even if it was to stay with reuse Android phone story, Java and Kotlin as regular Android app already provide all the juice required to do the job.

Well, the author embodies the true spirit of Hacker News. Without people publishing their experiments or learned things, others wouldn’t learn or feel inspired to ~hack things together.

One more reason to explore what it means to develop modern approaches to software development, instead of putting UNIX clones everywhere, basically frozen in time.

Re: My server is a phone now

#267

Earlier quoted context omitted.

A lot of phones nowadays are glued shut, you'll budget for a trained repair tech to do that. They also use the battery as a giant capacitor to absorb spike draws that wall chargers cannot provide, so the modified device will need that capacity as well. Finally, there will be some radio certification ambiguity as to whether it's legal for a legal company to operate. That said... there are Chinese rackable phone KVM th…

any way to find those rackable phone kvm things? My quick search came up empty. I might get someone interested in that. However, we're a very big European corporation, so "let's use social media fraud farms" and "hire talent from scam malls to build them" might not fly in a meeting :P

  https://chinese.alibaba.com/product-detail/Mobile-Phone-Group-Control-Equipment-Motherboard-1601460564510.html
  https://www.alibaba.com/product-detail/For-Samsung-Custom-Packaging-OTG-Memory_1601872798649.html
  https://aliexpress.com/item/1005010070778997.html
  https://aliexpress.com/item/1005012481751631.html
  https://www.tiktok.com/@xbus260430425/video/7671530564876258573
  https://www.tiktok.com/@xbus260430425/video/7663701554905582862
  https://www.instagram.com/reel/DP_UrdhEm8R/
Took me few minutes, but looks like one query that works for these on Alibaba/AliExpress/taobao is "click farming phone". "手机 主板 服務器"(phone mainboard server) might also work in some places.

I see bunch of multi GPU crypto mining style chassis as well as just USB mass charger styled ones. This is something I just came across randomly so I have no experiences or connections for these, but hope this helps. It's kind of cool looking if it weren't for scams.

edit: note, it's not clear if they come with the phone PCBs or phones are customer supplied. The "boards" mentioned in some of listing seem to imply that it refers to adapter boards for the phones, through subtle wording

Re: My server is a phone now

#268

Side comment about the difference between “My server is a phone now” and “My phone is a server now.” In linguistics, the terms “theme” and “rheme” refer to the status of information in a sentence [1]. The theme of a sentence is something that is known or can be assumed from the context (that is, old information), while the rheme is information that is newly introduced in the sentence, often as a comment on the theme.…

Yeah I first read it as he turned his server into a calling device.

As someone who just installed FreePBX on his home server, I guess I basically did that.

Re: My server is a phone now

#269
post #56

Earlier quoted context omitted.

It only makes sense if we are measuring raw capability per dollar. Once you factor in noise, physical size, idle power, battery etc, I think the calculation changes. For a home sever that's mostly idle, it is almost like commuting in a pickup truck.

Modern dell desktops (like 8th gen+) idle around 10W. Raspberry pi isn’t saving much

I made calculations and got the same results. Bought low profile and as a server
Post reply on HN